From 65bb4b35cf2d8e4810835fc0ec55d885c2cc88d8 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 23 Aug 2018 15:28:40 -0400 Subject: [PATCH] error handling --- GUI/mainwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 839c097..63da01e 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -212,6 +212,11 @@ void MainWindow::on_hookButton_clicked() void MainWindow::on_unhookButton_clicked() { QVector hooks = GetAllHooks(GetSelectedProcessId()); + if (hooks.size() == 0) + { + Host::AddConsoleOutput(L"no hooks detected"); + return; + } QStringList hookList; for (auto i : hooks) hookList.push_back( QString::fromStdWString(Host::GetHookName(GetSelectedProcessId(), i.address)) +