mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed search crash.
This commit is contained in:
@@ -992,7 +992,7 @@ function startSearch(evt) {
|
||||
var request = JSON.stringify({
|
||||
name: 'find',
|
||||
args: [
|
||||
evt.target.inputValue,
|
||||
evt.target.value,
|
||||
findNext
|
||||
]
|
||||
});
|
||||
|
||||
@@ -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
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user