Skip to content

Commit

Permalink
portals-list: filter out portal without real data (bug in intel)
Browse files Browse the repository at this point in the history
Portals with empty title causes exception when sorting
Anyway, table rows filled with <undefined> are not useful
  • Loading branch information
johndoe committed Oct 18, 2019
1 parent 5ec2475 commit bd3c937
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/portals-list.user.js
Original file line number Diff line number Diff line change
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 bd3c937

Please sign in to comment.