LWJGL
October 20, 2014, 19:07:18 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.1 released!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [FIXED] java.lang.NullPointerException - how to fix this?  (Read 13202 times)
DarkPeter
Newbie
*
Posts: 3


« on: October 19, 2011, 08:48:16 »

Hi,
previously I programmed games in NetBeans. Than I changed an application to Eclipse. I installed LWJGL and copy (from NetBeans to Eclipse) my code, but after run my game, Eclipse displays error:
Quote
Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.MemoryUtil.getAddress(MemoryUtil.java:126)
   at org.lwjgl.openal.ALC11.alcCaptureOpenDevice(ALC11.java:96)
   at org.lwjgl.test.openal.ALCCaptureTest.execute(ALCCaptureTest.java:92)
   at org.lwjgl.test.openal.ALCCaptureTest.main(ALCCaptureTest.java:151)
Do you know how to fix this error? What I should do?
Sorry for mistakes in English. I do not speak English very well.
Logged
roadkillguy
Newbie
*
Posts: 9


« Reply #1 on: October 19, 2011, 19:10:50 »

That kind of error is caused when you try to call a function or access data from a null pointer (a class that is null).  It's 100% code specific, so we'll need to see some code.

The following code would throw a java.lang.NullPointerException:

Quote
Class myclass = null;

myclass.doSomething();
Logged
Matzon
Administrator
Demigod
*****
Posts: 2242



« Reply #2 on: October 20, 2011, 00:32:56 »

confirmin... something with spasis utf8 changes is breaking alc, which is encoding the return string
Logged

Matzon
Administrator
Demigod
*****
Posts: 2242



« Reply #3 on: October 20, 2011, 00:48:05 »

right, so the generator doesn't like passing in NULL to MemoryUtil.getAddress(buffer) Smiley need to do a 'long address = buffer == null ? 0 : MemoryUtil.getAddress(buffer);' thingy ...
Unless someone looks into this soon - I wont be able to until tonight.
Logged

Matzon
Administrator
Demigod
*****
Posts: 2242



« Reply #4 on: October 20, 2011, 00:58:08 »

fixed in nightly - not a generator issue, just the utf8 changes
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!