Skip to content

Commit 70648a1

Browse files
committed
More thorough input checks for isPatternMissing function
Fixes regression introduced by #9380 ResolvedImage.fromString may now return null, which leaves CrossFaded<ResolvedImage> with possibly have missing patterns I have traced other code paths using ResolvedImage.fromString and have not seen any other potential offenders
1 parent 1a036c8 commit 70648a1

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/render/painter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class Painter {
589589
*/
590590
isPatternMissing(image: ?CrossFaded<ResolvedImage>): boolean {
591591
if (!image) return false;
592+
if (!image.from || !image.to) return true;
592593
const imagePosA = this.imageManager.getPattern(image.from.toString());
593594
const imagePosB = this.imageManager.getPattern(image.to.toString());
594595
return !imagePosA || !imagePosB;
-7.43 KB
Loading

test/integration/render-tests/regressions/mapbox-gl-js#9518/style.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"version": 8,
33
"metadata": {
44
"test": {
5-
"width": 64,
6-
"height": 64
5+
"width": 8,
6+
"height": 8
77
}
88
},
99
"zoom": 3,

0 commit comments

Comments
 (0)