Fixing NullPointerException
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.
- Go to the "Check Expiration Date" feature and enter or scan a barcode that is not already in the database.
- For
Category
select: "Condiments, Sauces, & Canned Goods" - For
Product
select: "Ketchup, cocktail, or chili sauce" - Press "Accept"
- 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 toNestDBDataSource
. - Updated
DisplayTrueExpirationFragment
to display onlydop_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.)