Fixed null pointer exception on ALC.alcOpenDevice failure
This commit is contained in:
parent
f277e5607d
commit
08fc228d2c
|
@ -178,7 +178,10 @@ public abstract class AL {
|
|||
ALC.create();
|
||||
|
||||
device = ALC.alcOpenDevice(deviceArguments);
|
||||
|
||||
if (device == null) {
|
||||
ALC.destroy();
|
||||
throw new LWJGLException("Could not open ALC device");
|
||||
}
|
||||
//check if doing default values or not
|
||||
if (contextFrequency == -1) {
|
||||
context = ALC.alcCreateContext(device.device, null);
|
||||
|
|
Loading…
Reference in New Issue