patzly / grocy-android

ERP beyond your fridge, now on your phone – An awesome companion app for grocy
https://patrickzedler.com/grocy/
GNU General Public License v3.0
905 stars 85 forks source link

Crash when scanning barcode for purchase, if barcode not in database #828

Closed Arcturuss closed 10 months ago

Arcturuss commented 10 months ago

App crashes when I scan new barcode for purchase, either with "purchase" button or "quickscan" button. Scanning for consume works fine. Scanning for purchase after barcode is added to the product in database works fine.

app v 3.5.0 from F-Droid, Android 13, Sony xperia 10 iv

Log:

01-19 00:35:55.022  1748  1748 E AndroidRuntime: FATAL EXCEPTION: main
01-19 00:35:55.022  1748  1748 E AndroidRuntime: Process: xyz.zedler.patrick.grocy, PID: 1748
01-19 00:35:55.022  1748  1748 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'android.view.View xyz.zedler.patrick.grocy.databinding.FragmentPurchaseBinding.dummyFocusView' on a null object reference in method 'void androidx.activity.ComponentDialog$$ExternalSyntheticLambda1.run()'
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at androidx.activity.ComponentDialog$$ExternalSyntheticLambda1.run(R8$$SyntheticClass:23)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at android.os.Handler.handleCallback(Handler.java:942)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at android.os.Handler.dispatchMessage(Handler.java:99)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at android.os.Looper.loopOnce(Looper.java:346)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at android.os.Looper.loop(Looper.java:475)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at android.app.ActivityThread.main(ActivityThread.java:7950)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at java.lang.reflect.Method.invoke(Native Method)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
01-19 00:35:55.022  1748  1748 E AndroidRuntime:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
patzly commented 10 months ago

Duplicate of #820 which is already fixed for the next version :)