ChristopherGittner / OSMBugs

OSMBugs
MIT License
23 stars 5 forks source link

Crash when setting empty cache size value #40

Closed opk12 closed 5 months ago

opk12 commented 5 months ago

Steps to reproduce:

FATAL EXCEPTION: main
Process: org.gittner.osmbugs, PID: 1074
java.lang.RuntimeException: Unable to create application org.gittner.osmbugs.App: java.lang.NumberFormatException: For input string: ""
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6013)
    at android.app.ActivityThread.-wrap3(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1727)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6816)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: java.lang.NumberFormatException: For input string: ""
    at java.lang.Long.parseLong(Long.java:455)
    at java.lang.Long.parseLong(Long.java:485)
    at org.gittner.osmbugs.statics.Settings.getCacheSizeMb(Settings.kt:51)
    at org.gittner.osmbugs.App.onCreate(App.kt:93)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6010)
    ... 8 more
opk12 commented 5 months ago

The maximum tile age setting's label says that 0 = default setting, maybe the cache size setting could imitate that.

ChristopherGittner commented 5 months ago

I added the Default value as a Hint and hopefully fixed this Error :-)