Skip to content

Commit

Permalink
fixed when enable dynamic atlas, _nativeData is null
Browse files Browse the repository at this point in the history
  • Loading branch information
ankye committed Jan 13, 2025
1 parent b0a138d commit 2d20699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cocos/asset/assets/image-asset.jsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ Object.defineProperty(imageAssetProto, 'width', {
configurable: true,
enumerable: true,
get () {
return this._nativeData.width || this._width;
return this._nativeData?.width || this._width;
}
});

Object.defineProperty(imageAssetProto, 'height', {
configurable: true,
enumerable: true,
get () {
return this._nativeData.height || this._height;
return this._nativeData?.height || this._height;
}
});

Expand Down

0 comments on commit 2d20699

Please sign in to comment.