Skip to content

Commit

Permalink
Guard against null bitmapData
Browse files Browse the repository at this point in the history
  • Loading branch information
starburst997 committed May 28, 2019
1 parent cea8910 commit a98eea1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/openfl/swfty/renderer/Layer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ class FinalLayer extends BaseLayer {
super.update(dt);
}

/*override function __renderGL(renderer:openfl.display.OpenGLRenderer):Void
{
// TODO: Create my own implementation creating the buffer on the swfty loop directly
// This is a copy / paste of GLTilemap from 8.4.0 because Context3D stuff is MEGA SLOW
openfl.opengl.GLTilemap.render(this, renderer);
__renderEvent(renderer);
}*/

override function set__mask(value:Rectangle) {
if (value == null) return null;

Expand Down Expand Up @@ -288,6 +296,12 @@ class FinalLayer extends BaseLayer {

override function loadTexture(bytes:Bytes, swfty:SWFTYType, ?onComplete:Void->Void, ?onError:Dynamic->Void) {
function complete(bmpd:BitmapData) {

if (bmpd == null) {
if (onError != null) onError('Null bitmapData');
return;
}

swfty.addAll(bmpd.width, bmpd.height);

// Create tileset
Expand Down

0 comments on commit a98eea1

Please sign in to comment.