Export to GitHub

libgdx - issue #1755

JsonValue.get(String name) causes null pointer


Posted on Aug 20, 2014 by Grumpy Dog
  1. Put attached json file into android assets folder
  2. Run this code anywhere in the application

JsonReader reader = new JsonReader(); JsonValue jsonValue = reader.parse(Gdx.files.internal("ArrayException.json"));

jsonValue.get("TestArray").get("Type");

  1. Observe that null pointer is being thrown.

JsonValue.get(String name) is not checking whether name is not null, causing null pointer.

Attachments

Comment #1

Posted on Sep 11, 2014 by Swift Cat

The libGDX issue tracker has been moved to https://github.com/libgdx/libgdx/issues. This issue tracker is not monitored and should not be used. To prevent others from using this issue tracker, I will close this issue now. If you haven't done so already, please consider posting your issue on the new issue tracker at https://github.com/libgdx/libgdx/issues.

Status: Invalid

Labels:
Type-Defect Priority-Medium