Fixed null pointer exception on ALC.alcOpenDevice failure

This commit is contained in:
Elias Naur 2004-05-02 15:46:55 +00:00
parent f277e5607d
commit 08fc228d2c
1 changed files with 4 additions and 1 deletions

View File

@ -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);