From de063e3e84da8a8077eba18720ef4754a99f9afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 30 Dec 2014 13:34:03 +0100 Subject: [PATCH] Fix crash when a network interface is removed This resolves Bug 2278 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdenetworkmanager/src/tdenetman-tray.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tdenetworkmanager/src/tdenetman-tray.cpp b/tdenetworkmanager/src/tdenetman-tray.cpp index 6b19a12..533fa7e 100644 --- a/tdenetworkmanager/src/tdenetman-tray.cpp +++ b/tdenetworkmanager/src/tdenetman-tray.cpp @@ -447,14 +447,15 @@ void Tray::slotRemoveDeviceTrayComponent(TQString dev) // remove the appropriate action TDENetworkDevice* dev_comp_dev = dynamic_cast(hwdevices->findByUniqueID(dev_comp->device())); - TQString actionName = TQString("new_connection_%1").arg(dev_comp_dev->deviceNode()); - TDEAction * deviceNewConnAction = actionCollection ()->action (actionName); - - if (!deviceNewConnAction) - { - delete deviceNewConnAction; - deviceNewConnAction = NULL; + if (dev_comp_dev) { + TQString actionName = TQString("new_connection_%1").arg(dev_comp_dev->deviceNode()); + TDEAction * deviceNewConnAction = actionCollection ()->action (actionName); + if (!deviceNewConnAction) { + delete deviceNewConnAction; + deviceNewConnAction = NULL; + } } + // remove device_tray and delete it d->trayComponents.remove(it); delete dev_comp;