From 3e4e2ae4bb8ecddcc7a5d95194f7217f89cdc08f Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Wed, 27 Nov 2019 18:57:00 -0500 Subject: [PATCH] dont short circuit --- src/render/image_manager.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/render/image_manager.js b/src/render/image_manager.js index 77d401920fd..65fc94c24b6 100644 --- a/src/render/image_manager.js +++ b/src/render/image_manager.js @@ -93,19 +93,20 @@ class ImageManager extends Evented { } _validate(id: string, image: StyleImage) { + let valid = true; if (!this._validateStretch(image.stretchX, image.data && image.data.width)) { this.fire(new ErrorEvent(new Error(`Image "${id}" has invalid "stretchX" value`))); - return false; + valid = false; } if (!this._validateStretch(image.stretchY, image.data && image.data.height)) { this.fire(new ErrorEvent(new Error(`Image "${id}" has invalid "stretchY" value`))); - return false; + valid = false; } if (!this._validateContent(image.content, image)) { this.fire(new ErrorEvent(new Error(`Image "${id}" has invalid "content" value`))); - return false; + valid = false; } - return true; + return valid; } _validateStretch(stretch: ?Array<[number, number]> | void, size: number) {