Skip to content

Commit b892b0d

Browse files
authored
Merge pull request #330 from kuvelas/master
fix: test for null marker passed in to _getInfoWindowTemplate
2 parents cfc61d3 + 8290240 commit b892b0d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/map-view-common.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,12 @@ export abstract class MapViewBase extends View implements MapView {
237237
}
238238

239239
public _getInfoWindowTemplate(marker: MarkerBase): KeyedTemplate {
240-
const templateKey = marker.infoWindowTemplate;
241-
for (let i = 0, length = this._infoWindowTemplates.length; i < length; i++) {
242-
if (this._infoWindowTemplates[i].key === templateKey) {
243-
return this._infoWindowTemplates[i];
240+
if(marker){
241+
const templateKey = marker.infoWindowTemplate;
242+
for (let i = 0, length = this._infoWindowTemplates.length; i < length; i++) {
243+
if (this._infoWindowTemplates[i].key === templateKey) {
244+
return this._infoWindowTemplates[i];
245+
}
244246
}
245247
}
246248
return this._defaultInfoWindowTemplate;
@@ -575,4 +577,4 @@ export class CircleBase extends ShapeBase implements Circle {
575577
public strokeWidth: number;
576578
public strokeColor: Color;
577579
public fillColor: Color;
578-
}
580+
}

0 commit comments

Comments
 (0)