From c8e0c474efcfca193a57560d1a26ee5157654f4d Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Sun, 21 Jun 2015 19:43:21 -0700 Subject: [PATCH] Fixed crash --- kcm/kcm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index 00b397266..09d56e082 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -143,6 +143,9 @@ void KdeConnectKcm::refresh() void KdeConnectKcm::resetSelection() { + if (!currentDevice) { + return; + } kcmUi->deviceList->selectionModel()->setCurrentIndex(sortProxyModel->mapFromSource(currentIndex), QItemSelectionModel::ClearAndSelect); } @@ -162,6 +165,7 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current) pluginsConfigChanged(); if (!current.isValid()) { + currentDevice = NULL; kcmUi->deviceInfo->setVisible(false); return; }