From c88fd11db47a7dc92cf4ba206fe85227c1b6160e Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Fri, 5 Nov 2021 20:21:16 -0700 Subject: [PATCH] added null pointer check to EaglerAdapterImpl2 --- .../net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index b51123f..9d329a2 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -1114,6 +1114,7 @@ public class EaglerAdapterImpl2 { AudioBufferX ret = loadedSoundFiles.get(fileName); if(ret == null) { byte[] file = loadResourceBytes(fileName); + if(file == null) return null; Uint8Array buf = Uint8Array.create(file.length); buf.set(file); ret = new AudioBufferX(decodeAudioAsync(buf.getBuffer()));