mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2025-02-17 11:50:18 -05:00
Merge pull request #866 from LLK/fix_empty_png
Don't thrown an exception when loadBytes fails.
This commit is contained in:
commit
20902bf8a1
1 changed files with 5 additions and 1 deletions
|
@ -547,7 +547,11 @@ spriteFeaturesFilter.visible = false; // disable features filter for now
|
|||
var loader:Loader = new Loader();
|
||||
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageDecoded);
|
||||
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(e:Event):void { decodeError(); });
|
||||
loader.loadBytes(data);
|
||||
try {
|
||||
loader.loadBytes(data);
|
||||
} catch(e:*) {
|
||||
decodeError();
|
||||
}
|
||||
} else if (fExt == '.gif') {
|
||||
try {
|
||||
importGIF(fName, data);
|
||||
|
|
Loading…
Reference in a new issue