Skip to content

Fixing NullPointerException

Tyler Sizse requested to merge issue_226_null_pointer_exception into main

License and Copyright Notice

By submitting this issue or commenting on this issue, or contributing any content to this issue, you certify under the Developer Certificate of Origin that the content you post may be licensed under GPLv3 (for code) or CC-BY-SA 4.0 International (for non-code content).

Branch Name

issue_226_null_pointer_exception

Related Issues

Closes #226 (closed);

Dependencies

None

Description

This merge request will fix the NullPointerException that is causing the app to crash, by displaying N/A if the data is null, and it will also convert DisplayTrueExpirationFragment to display only the dop_pantryLife shelf life.

Steps to Test

Make sure to wipe data from your device so the database is recreated.

  1. Go to the "Check Expiration Date" feature and enter or scan a barcode that is not already in the database.
  2. For Category select: "Condiments, Sauces, & Canned Goods"
  3. For Product select: "Ketchup, cocktail, or chili sauce"
  4. Press "Accept"
  5. Press "Accept"

Expected Behavior

The app should no longer crash, it should display only the dop_pantryLife shelf life, and should now display N/A for any null data values.

Relevant Screenshots

N/A

Relevant Logs

N/A

Developer Notes

  • Added new getItemShelfLife(int productId, int typeIndex) method to NestDBDataSource.
  • Updated DisplayTrueExpirationFragment to display only dop_pantryLife.

Labels

NEST component::check-expiration-date type::bug status::done

(NOTE: Make sure to paste links to any merge request dependencies down below in the other text box.)

Edited by Tyler Sizse

Merge request reports