Simplix-Softworks / SimplixStorage

Library to store data in a better way
Apache License 2.0
138 stars 25 forks source link

NPE when using json created from (final File file) constructor #5

Closed OfficialDonut closed 5 years ago

OfficialDonut commented 5 years ago

Describe the bug An NPE is thrown when you try to use a json created from the (final File file) constructor. This does not happen when using a different constructor. I also tested the (final File file) constructor with yaml and that does work

To Reproduce

Json json = new Json(new File("C:\\some\\path\\test.json"));
json.set("test", 1);
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
    at de.leonhard.storage.Json.reload(Json.java:156)
    at de.leonhard.storage.Json.set(Json.java:444)
KotlinFactory commented 5 years ago

Hi, thank you for using LightningStorage & your help to improve it! We have fixed this bug. Please update to 2.4 Issues will be processed more quickly in the future. Notifications were disabled.

Greetings, Leonhard | EsGibtKeineMitte | JavaFactory