summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-08-25 07:04:25 +0200
committerMontel Laurent <[email protected]>2015-08-25 07:04:25 +0200
commitb17d02b0e21742d5928c0c159b19d16c9e650e77 (patch)
treeb03f9adb0b1301959243f2191e3c3ab72f59abcc
parent9794c508d93842b0da3ca77146ad29f000536527 (diff)
Fix potential crash (found by coverty)
-rw-r--r--kmail/kmmainwidget.cpp4
-rw-r--r--pimcommon/storageservice/settings/storageservicesettingswidget.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/kmail/kmmainwidget.cpp b/kmail/kmmainwidget.cpp
index da7c819..49c96c5 100644
--- a/kmail/kmmainwidget.cpp
+++ b/kmail/kmmainwidget.cpp
@@ -4387,7 +4387,9 @@ void KMMainWidget::itemsFetchDone(KJob *job)
if (kmkernel->isOffline()) {
showOfflinePage();
} else {
- showResourceOfflinePage();
+ if (mMsgView) {
+ showResourceOfflinePage();
+ }
}
} else {
// Some other error
diff --git a/pimcommon/storageservice/settings/storageservicesettingswidget.cpp b/pimcommon/storageservice/settings/storageservicesettingswidget.cpp
index ddfc41d..f50df84 100644
--- a/pimcommon/storageservice/settings/storageservicesettingswidget.cpp
+++ b/pimcommon/storageservice/settings/storageservicesettingswidget.cpp
@@ -127,8 +127,8 @@ void StorageServiceSettingsWidget::slotAuthenticate()
QListWidgetItem *item = mListService->currentItem();
if (item) {
const QString serviceName = item->data(Name).toString();
- if (mListStorageService.contains(serviceName)) {
- StorageServiceAbstract *storage = mListStorageService.value(serviceName);
+ auto storage = mListStorageService.value(serviceName);
+ if (storage) {
storage->authentication();
}
}
@@ -390,8 +390,8 @@ void StorageServiceSettingsWidget::slotModifyService()
QListWidgetItem *item = mListService->currentItem();
if (item) {
const QString serviceName = item->data(Name).toString();
- if (mListStorageService.contains(serviceName)) {
- StorageServiceAbstract *storage = mListStorageService.value(serviceName);
+ auto storage = mListStorageService.value(serviceName);
+ if (storage) {
storage->authentication();
}
}