]> git.siccegge.de Git - frida/frida.git/commitdiff
Handle cancel on InterpreterMenu
authorChristoph Egger <christoph@anonymous.siccegge.de>
Fri, 15 May 2015 23:25:20 +0000 (01:25 +0200)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Fri, 15 May 2015 23:25:20 +0000 (01:25 +0200)
getOpenFileName() will return a Null-QString on cancel. Feeding that
filename to guile will die (reasonably) with an exception. Instead, we
now just exit from the handler in the gui if the Null-QString is
returned

Closes T33

src/gui/Mainwindow.cxx

index 7ea9012bf9ed8fe45e3dd4578234d59160d48237..544d5fd7dc65efee0af1d8d5f7ab194b1a93b291 100644 (file)
@@ -58,9 +58,11 @@ Mainwindow::Mainwindow(InformationManager* mgr)
                        QString fileName = QFileDialog::getOpenFileName(this, tr("Open Script"), "",
                                                                        tr("Binaries") + " (*." +
                                                                        manager->getInterpreter("GUILE")->fileExtension().c_str() + ")");
-                       std::stringstream a, b;
-                       std::string c;
-                       manager->getInterpreter("GUILE")->loadFile(fileName.toStdString(), a, b, c);
+                       if(! fileName.isNull()) {
+                               std::stringstream a, b;
+                               std::string c;
+                               manager->getInterpreter("GUILE")->loadFile(fileName.toStdString(), a, b, c);
+                       }
                });
 
        listWidget = new QTreeWidget();