Fixed search crash.

This commit is contained in:
Oliver Hamlet
2014-11-13 11:02:30 +00:00
parent 371a3fc24c
commit 8aab542cf7
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -992,7 +992,7 @@ function startSearch(evt) {
var request = JSON.stringify({
name: 'find',
args: [
evt.target.inputValue,
evt.target.value,
findNext
]
});
+4 -1
View File
@@ -30,6 +30,7 @@
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-input/paper-input-decorator.html">
<link rel="import" href="bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html">
@@ -135,7 +136,9 @@
</core-menu>
</core-animated-pages>
<core-tooltip label="Press Enter when searching to select the next match." position="top">
<paper-input id="searchBox" type="search" label="Search content..."></paper-input>
<paper-input-decorator label="Your Name">
<input id="searchBox" is="core-input" type="search">
</paper-input-decorator>
</core-tooltip>
</div>
<div main id="main">
+8 -2
View File
@@ -198,8 +198,14 @@ namespace loot {
if (requestName == "find") {
// Has one arg, which is the search string.
Find(browser, request["args"][0].as<string>(), request["args"][1].as<bool>());
callback->Success("");
try {
Find(browser, request["args"][0].as<string>(), request["args"][1].as<bool>());
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") {