From 8aab542cf713572337834bb64cfc0e126439c4c8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 11:02:30 +0000 Subject: [PATCH] Fixed search crash. --- resources/report/js/script.js | 2 +- resources/report/report.html | 5 ++++- src/gui/handler.cpp | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/report/js/script.js b/resources/report/js/script.js index dcc290e6..f6fdc158 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -992,7 +992,7 @@ function startSearch(evt) { var request = JSON.stringify({ name: 'find', args: [ - evt.target.inputValue, + evt.target.value, findNext ] }); diff --git a/resources/report/report.html b/resources/report/report.html index 1dc332df..285133b3 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -30,6 +30,7 @@ + @@ -135,7 +136,9 @@ - + + +
diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index b49c22dd..7bf9e033 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -198,8 +198,14 @@ namespace loot { if (requestName == "find") { // Has one arg, which is the search string. - Find(browser, request["args"][0].as(), request["args"][1].as()); - callback->Success(""); + try { + Find(browser, request["args"][0].as(), request["args"][1].as()); + callback->Success(""); + } + catch (std::exception& e) { + BOOST_LOG_TRIVIAL(error) << "Failed to perform search. Details: " << e.what(); + callback->Failure(-1, string("Failed to perform search. Details: ") + e.what()); + } return true; } else if (requestName == "changeGame") {