From c308c430c3eae111b616f5220cad51c1425d547c Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Mon, 2 Sep 2024 22:40:41 +0100 Subject: [PATCH] The `NineSlice` Game Object will now guard against an invalid texture by checking for the `frame` and `textureFrame` vars before trying to read values from them. Fix #6804 --- src/gameobjects/nineslice/NineSlice.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gameobjects/nineslice/NineSlice.js b/src/gameobjects/nineslice/NineSlice.js index 2cdbfc31c..614f9ffc6 100644 --- a/src/gameobjects/nineslice/NineSlice.js +++ b/src/gameobjects/nineslice/NineSlice.js @@ -312,7 +312,7 @@ var NineSlice = new Class({ */ this.is3Slice = (!topHeight && !bottomHeight); - if (textureFrame.scale9) + if (textureFrame && textureFrame.scale9) { // If we're using the scale9 data from the frame, override the values from above this.is3Slice = textureFrame.is3Slice; @@ -382,7 +382,7 @@ var NineSlice = new Class({ } else { - if (frame.scale9 && !skipScale9) + if (frame && frame.scale9 && !skipScale9) { var data = frame.data.scale9Borders;