NullPointerException: de.jreality.writer.u3d.U3DSceneUtility

Found a bug? Post here.
Post Reply
Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

NullPointerException: de.jreality.writer.u3d.U3DSceneUtility

Post by Joe » Sun 4. Sep 2011, 19:14

Hi,
in ...

Code: Select all

	public static SceneGraphComponent getSkyBox(JrScene scene) {
		Appearance rootApp = scene.getSceneRoot().getAppearance();
		Object skyBoxAttribute = rootApp.getAttribute(SKY_BOX);
		if (rootApp == null || skyBoxAttribute == INHERITED) {
			return null;
		}
		...
... you check for "rootApp == null", after you access it one line above. This leads to a NullPointerException, if there's no root appearance.

Best regards, Joe

sechel
Posts: 69
Joined: Tue 2. Oct 2007, 09:20

Re: NullPointerException: de.jreality.writer.u3d.U3DSceneUti

Post by sechel » Fri 9. Sep 2011, 13:12

That is strange. My version of August 29. reads:

Code: Select all

	public static SceneGraphComponent getSkyBox(JrScene scene) {
		Appearance rootApp = scene.getSceneRoot().getAppearance();
		if (rootApp == null || rootApp.getAttribute(SKY_BOX) == INHERITED) {
			return null;
		}
		CubeMap skyBox = (CubeMap)createAttributeEntity(CubeMap.class, SKY_BOX, rootApp, true);

Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Re: NullPointerException: de.jreality.writer.u3d.U3DSceneUti

Post by Joe » Sun 11. Sep 2011, 19:57

I used the released source code from 2011-08-04. I should first check the SVN before reporting a bug. Sorry.

Post Reply