Fix crash in TasksModel::clear()

Authored by aspotashev on May 19 2019, 3:49 AM.