Skip to content

Search bar not responding #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DesertSnak3 opened this issue Feb 2, 2020 · 3 comments
Open

Search bar not responding #11

DesertSnak3 opened this issue Feb 2, 2020 · 3 comments
Assignees
Labels

Comments

@DesertSnak3
Copy link

Any search that is longer than 1 or 2 characters will crash the search and return an error:

vue.min.js:6 TypeError: Cannot read property 'toLowerCase' of null
at Ot.searchResults (gui.js:119)
at Uo.get (vue.min.js:6)
at Uo.evaluate (vue.min.js:6)
at Ot.searchResults (vue.min.js:6)
at Ot.searchResultsOpen (gui.js:36)
at Uo.get (vue.min.js:6)
at Uo.evaluate (vue.min.js:6)
at Ot.searchResultsOpen (vue.min.js:6)
at Ot.eval (eval at wi (vue.min.js:1), :3:4292)
at Ot.e._render (vue.min.js:6)

@woubuc
Copy link
Owner

woubuc commented Feb 2, 2020

I see, it's because there are guard towers without a creator/owner name attached (probably spawned in somehow, or edited). The solution is relatively simple - add a check on creator names to make sure they contain a value before trying to parse them, and if not provide fallback values on lines 78, 110 and 160.

I'll try to fix this soon and release a new version. In the meantime, I don't know if it's possible to fix or re-build the offending towers and other structures so they do have an owner, but you can check which ones are causing problems in the JSON files in the generated data directory. Search the files for "creator":null.

@woubuc woubuc added the bug label Feb 2, 2020
@woubuc woubuc self-assigned this Feb 2, 2020
@revelation343
Copy link

Can confirm locating structures and assigning them owners or deleting them and then re-running the script solves the issue. Thanks for the explanation @woubuc

@Celarious
Copy link

Added the basic check and fallback values for the creator names in a PR, fixes this bug as tested on a private server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants