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

This commit is contained in:
Richard Davey 2024-09-02 22:40:41 +01:00
parent 3041dabe9e
commit c308c430c3
No known key found for this signature in database

View file

@ -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;