added null pointer check to EaglerAdapterImpl2
This commit is contained in:
parent
c4577eb1d3
commit
c88fd11db4
|
@ -1114,6 +1114,7 @@ public class EaglerAdapterImpl2 {
|
||||||
AudioBufferX ret = loadedSoundFiles.get(fileName);
|
AudioBufferX ret = loadedSoundFiles.get(fileName);
|
||||||
if(ret == null) {
|
if(ret == null) {
|
||||||
byte[] file = loadResourceBytes(fileName);
|
byte[] file = loadResourceBytes(fileName);
|
||||||
|
if(file == null) return null;
|
||||||
Uint8Array buf = Uint8Array.create(file.length);
|
Uint8Array buf = Uint8Array.create(file.length);
|
||||||
buf.set(file);
|
buf.set(file);
|
||||||
ret = new AudioBufferX(decodeAudioAsync(buf.getBuffer()));
|
ret = new AudioBufferX(decodeAudioAsync(buf.getBuffer()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user