Skip to content

Commit

Permalink
fix: NPE
Browse files Browse the repository at this point in the history
Closes OPENFOODFACTS-ANDROID-4RE
  • Loading branch information
VaiTon committed Mar 27, 2022
1 parent ed774ca commit d54533f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -406,8 +406,9 @@ class EditIngredientsFragment : ProductEditFragment() {
* adds only those fields to the query map which are not empty and have changed.
*/
override fun getUpdatedFieldsMap(): Map<String, String?> {
// TODO: hacky fix, better use a shared view model for saving product details
if (activity !is ProductEditActivity || _binding == null) return emptyMap()
val targetMap = mutableMapOf<String, String?>()
if (activity !is ProductEditActivity) return targetMap

binding.traces.chipifyAllUnterminatedTokens()

Expand Down

0 comments on commit d54533f

Please sign in to comment.