aperture-tiles icon indicating copy to clipboard operation
aperture-tiles copied to clipboard

Null Pointer Exception with empty overlay

Open eric-kimbrel opened this issue 9 years ago • 0 comments

In JsonUntilities.overlayInPlace line 123:

  for (String key: JSONObject.getNames(overlay)) { .. }

If the overlay is an empty object ( i.e. {} ) getNames returns null and a Null Pointer exception is thrown.

Can be fixed with a simple null check, but I am not 100% sure that there isn't something wrong with my standard tiling job set up that is the true root cause of this error.

fix:

String[] names = JSONObject.getNames(overlay);
        if (names != null){
            for (String key: JSONObject.getNames(overlay)) {...}
..}

eric-kimbrel avatar Jun 17 '15 16:06 eric-kimbrel