LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: ra4king on September 05, 2012, 22:56:50

Title: [FIXED] Throwing a better exception than NPE
Post by: ra4king on September 05, 2012, 22:56:50
If Display.create() is not called or an exception is thrown while creating a GL context, the ContextCapabilities class is never initialized, causing all GL methods to throw an NPE when invoked. This has caused massive confusion for users when they don't realize that their context has never been created.

I request a better exception to be thrown if GLContext.getCapabilities() returns null.
Title: Re: [RFE] Throwing a better exception than NPE
Post by: spasi on September 06, 2012, 07:12:38
Done.
Title: Re: [RFE] Throwing a better exception than NPE
Post by: princec on September 06, 2012, 07:33:43
Er, what has been done?

Cas :)
Title: Re: [RFE] Throwing a better exception than NPE
Post by: spasi on September 06, 2012, 07:48:37
GLContext.getCapabilities() will throw a RuntimeException instead of returning null when there's no current GL context in the current thread.
Title: Re: [FIXED] Throwing a better exception than NPE
Post by: ra4king on September 06, 2012, 11:21:05
Thanks! :)