thirdy / durian

Path of Exile Items watcher
http://thirdy.github.io/durian/
GNU General Public License v2.0
35 stars 10 forks source link

Exception error on Linux #1

Closed Dryvnt closed 8 years ago

Dryvnt commented 8 years ago

I downloaded the latest release of durian and attempted to run it. I was instantly given an exception error, and the program then did nothing else. I also tried version 0.1, which had the same result.

Reproduction and error:

dryvnt:durian/ $ java-jar durian-v0.1.1.jar
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at net.thirdy.durian.util.config.ItemWatchConfig$ItemWatch.fromConfig(ItemWatchConfig.java:92)
    at net.thirdy.durian.util.config.ItemWatchConfig.lambda$3(ItemWatchConfig.java:37)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at net.thirdy.durian.util.config.ItemWatchConfig.loadItemWatchList(ItemWatchConfig.java:38)
    at net.thirdy.durian.ui.DurianApplication.start(DurianApplication.java:102)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
    ... 1 more
Dryvnt commented 8 years ago

Did some testing. Seems to happen because of empty itemwatch.txt file in ~/.durian

Replacing it with the default itemwatch found in .durian/durian/src/main/resources/net/thirdy/durian/util/config seems to fix the problem. Deleting ~/.durian and restarting the application causes the problem again.

It seems to come from not properly putting the default itemwatch in the folder.

Dryvnt commented 8 years ago

The empty line in the empty itemwatch was being parsed as being a character, for some reason. See my pull request for a fix