From d277d5c68b995fad5620f4adb998c4bdbdc694b9 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Wed, 10 May 2017 12:45:53 +0300 Subject: [PATCH] Check for nullptr before delete --- src/LoginPage.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/LoginPage.cc b/src/LoginPage.cc index f00f3a28..09cfb82c 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -189,11 +189,15 @@ void LoginPage::reset() matrixid_input_->clear(); password_input_->clear(); - settings_modal_->deleteLater(); - login_settings_->deleteLater(); + if (settings_modal_ != nullptr) { + settings_modal_->deleteLater(); + settings_modal_ = nullptr; + } - login_settings_ = nullptr; - settings_modal_ = nullptr; + if (login_settings_ != nullptr) { + login_settings_->deleteLater(); + login_settings_ = nullptr; + } } void LoginPage::onBackButtonClicked()