Bug A bug in rmmz_core

In TilingSprite's _onBitmapLoad method, there's no bitmap check like in Sprite's _onBitmapLoad. This could cause errors when the bitmap changes multiple times, as it may attempt to use a null bitmap.

JavaScript:
Sprite.prototype._onBitmapLoad = function(bitmapLoaded) {
    if (bitmapLoaded === this._bitmap) {
        if (this._refreshFrame && this._bitmap) {
            this._refreshFrame = false;
            this._frame.width = this._bitmap.width;
            this._frame.height = this._bitmap.height;
        }
    }
    this._refresh();
};
JavaScript:
TilingSprite.prototype._onBitmapLoad = function() {
    this.texture.baseTexture = this._bitmap.baseTexture;
    this._refresh();
};
The refresh is always called in your first example, even when the if-check returns false. Does it even happen that onBitmapLoad is called multiple times?
The refresh is always called in your first example, even when the if-check returns false. Does it even happen that onBitmapLoad is called multiple times?
This is a bug I actually encountered in my project. Let me give a simple example:

JavaScript:
tilingSprite.bitmap = ImageManager.xxxx(xxx);
tilingSprite.bitmap = null;

When the asynchronous image loading completes after the first assignment, it triggers _onBitmapLoad, but at this point this._bitmap is null, which directly causes an error.
However, this doesn't happen with Sprite because it checks whether the loaded bitmap matches this._bitmap

Original thread: https://forums.rpgmakerweb.com/threads/a-bug-in-rmmz_core.179981/