Skip to content

Commit

Permalink
Merge pull request #265 from johnd0e/fix-portal-list
Browse files Browse the repository at this point in the history
portals-list: filter out portal without real data (bug in intel)

Portals with empty title causes exception when sorting
Anyway, table rows filled with <undefined> are not useful
  • Loading branch information
johnd0e committed Nov 1, 2019
2 parents 32c4864 + bd3c937 commit 8d82311
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/portals-list.user.js
Expand Up @@ -154,6 +154,14 @@ window.plugin.portalslist.getPortals = function() {
// eliminate offscreen portals (selected, and in padding)
if(!displayBounds.contains(portal.getLatLng())) return true;

if (!portal.options.data.title) { // no data about portal
// bug in intel, observed with ghost fields
// todo: check if such portal is really duplicate
// otherwise better keep it (with data filled by some defaults)
console.warn('filtering out "ghost" portal:', portal.options.data);
return true;
}

retval=true;

switch (portal.options.team) {
Expand Down

0 comments on commit 8d82311

Please sign in to comment.