Skip to content
Snippets Groups Projects

Resolve "minerva popup `Cannot read property 'getModel' of null`"

Merged Piotr Gawron requested to merge 432-minerva-popup into devel_11.1.x-clean
2 files
+ 87
65
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -180,6 +180,12 @@ AbstractDbOverlay.prototype.searchByEncodedQuery = function (originalQuery, fitB
return this.searchNamesByTarget(query.target);
} else if (query.type === AbstractDbOverlay.QueryType.SEARCH_BY_COORDINATES) {
query.coordinates = new google.maps.Point(query.coordinates.x, query.coordinates.y);
if (this.getMap().getSubmapById(query.modelId) === null) {
//this can happen when cached data comes from project that was removed and something else
//was uploaded with the same name
logger.warn("Invalid search query. Model doesn't exist: " + query.modelId);
return Promise.resolve();
}
return this.searchByCoordinates(query);
} else {
throw new Error("Unknown type of query: " + query.type);
Loading