arghblargh / feh-inheritance-tool

Fire Emblem: Heroes Skill Inheritance Tool

Home Page:https://arghblargh.github.io/feh-inheritance-tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS errors on certain heroes

plaidman opened this issue · comments

When I load up certain heroes, such as Alphonse or Alm, I will get an error that looks something like:

Uncaught (in promise) TypeError: Cannot read property '1' of null
    at Object.<anonymous> (helper.js:142)
    at <anonymous>

I've seen it on line 142 and 155 so far, but there may be others. This has the unfortunate side effect of killing the JS when it's trying to grab builds from the wiki, so the build select dropdown isn't populating for any hero that triggers this error.

That happens because it pulls build data from the wiki source, which can be wildly inconsistent (e.g. missing fields, strange formatting, etc.).

I can do a check to ignore some errors, but I don't think I'll be able to fully fix it without the wiki enforcing some sort of standard format.

Thanks for the quick response!

I figured it would be something like that. I think if the regex doesn't match, the names of the builds should still be listed in the dropdown. If that option is selected, maybe just display the text from the build further down the page (instead of populating the table), or give a link to the build page on the wiki somewhere.

Well I can at least fix it so it loads something instead of nothing. I'll try to get a fix in later today.

Formatting errors should all be handled without breaking everything else.

Builds it can read will be loaded normally, and broken builds may be partially loaded.