From 5e4b9bc74c83f6ce5fc001322e10965f6e067458 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Sat, 10 Nov 2018 13:09:23 -0800 Subject: [PATCH] #41 Check connection to prevent crash --- src/mainwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ce1697..243d1e8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -561,6 +561,11 @@ void MainWindow::postToZBoard() { } void MainWindow::doImport(QList* keys) { + if (rpc->getConnection() == nullptr) { + // No connection, just return + return; + } + if (keys->isEmpty()) { delete keys;