Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException #4614

Closed
sentry-io bot opened this issue Mar 26, 2022 · 2 comments · Fixed by #4629
Closed

NullPointerException #4614

sentry-io bot opened this issue Mar 26, 2022 · 2 comments · Fixed by #4629
Labels

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 26, 2022

Sentry Issue: OPENFOODFACTS-ANDROID-4RE

NullPointerException: None
    at openfoodfacts.github.scrachx.openfood.features.product.edit.nutrition.ProductEditNutritionFactsFragment.getBinding(ProductEditNutritionFactsFragment.kt:71)
    at openfoodfacts.github.scrachx.openfood.features.product.edit.nutrition.ProductEditNutritionFactsFragment.getUpdatedFieldsMap(ProductEditNutritionFactsFragment.kt:556)
    at openfoodfacts.github.scrachx.openfood.features.product.edit.ProductEditActivity.getUpdatedFieldsMap(ProductEditActivity.kt:297)
    at openfoodfacts.github.scrachx.openfood.features.product.edit.ProductEditActivity.saveProduct(ProductEditActivity.kt:288)
    at openfoodfacts.github.scrachx.openfood.features.product.edit.ProductEditActivity.access$saveProduct(ProductEditActivity.kt:77)
...
(28 additional frame(s) were not displayed)
@g123k g123k added the NPE label Mar 28, 2022
@g123k
Copy link
Contributor

g123k commented Mar 28, 2022

@VaiTon I'm not sure how to fix this error, as the view (binding) is null.
Should we stop the request here? or instead, return an empty map?

@VaiTon
Copy link
Member

VaiTon commented Apr 4, 2022

To generally fix the problem we would need to upgrade our weak Fragment interconnection to a shared viewmodel for the product edit screen. For now we can just return an emptymap if the fragment is null.

Maybe throw a warning so that we know we did it and if we have issues regarding data loss we can track it down.

VaiTon added a commit to VaiTon/openfoodfacts-androidapp that referenced this issue Apr 7, 2022
VaiTon added a commit that referenced this issue Apr 7, 2022
* fix: NPE in ProductCompareAdapter

Closes #4614

* build: use 2G ram max for gradle build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants