Skip to content

Commit afeb1a9

Browse files
aymeric-ducheindavinkevin
authored andcommitted
fix(source): check host instance before setSource (#193)
1 parent d79d96c commit afeb1a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/ngx-openlayers/src/lib/sources/source.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class SourceComponent implements OnDestroy {
1414
constructor(protected host: LayerComponent, protected raster?: SourceRasterComponent) {}
1515

1616
ngOnDestroy() {
17-
if (this.host) {
17+
if (this.host && this.host.instance) {
1818
this.host.instance.setSource(null);
1919
}
2020

0 commit comments

Comments
 (0)