Skip to content

Commit c73f84e

Browse files
add extra check on style obj (#142)
* add extra check on style obj * changelog update
1 parent 8477320 commit c73f84e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# MapTiler SDK Changelog
22

33
## 2.5.1
4-
### Bug fixes
4+
### Bug Fixes
5+
- Added extra integrity checks on style object when updating language (https://github.com/maptiler/maptiler-sdk-js/pull/142)
56
- The Geolocate control no longer throwing error when window is lost (issue on Firefox only) (https://github.com/maptiler/maptiler-sdk-js/pull/140)
67

78
## 2.5.0

src/Map.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ export class Map extends maplibregl.Map {
928928
}
929929

930930
private getStyleLanguage(): LanguageInfo | null {
931-
if (!this.style.stylesheet.metadata) return null;
931+
if (!this.style || !this.style.stylesheet || !this.style.stylesheet.metadata) return null;
932932
if (typeof this.style.stylesheet.metadata !== "object") return null;
933933

934934
if (

0 commit comments

Comments
 (0)