Skip to content

Fix: openfoodfacts: handle product with null name. - #43

Open
GoodOldJack12 wants to merge 1 commit into
manuel-rw:masterfrom
GoodOldJack12:openfoodfacts-null-fix
Open

Fix: openfoodfacts: handle product with null name.#43
GoodOldJack12 wants to merge 1 commit into
manuel-rw:masterfrom
GoodOldJack12:openfoodfacts-null-fix

Conversation

@GoodOldJack12

Copy link
Copy Markdown
Contributor

Not sure what causes it, but this product: https://world.openfoodfacts.org/product/5414807007998/
Has a null name according to the client. The API does list it with a name, so I'm not sure what's going on.
I suspect its something to do with OpenFoodFacts4Net, since it hasn't been updated in 3 years.

I might look into fixing either forking that library or just creating a solution inside grocy-scanner.
Anyway, a product with a null name shouldn't cause the application to crash, hence this fix.

@manuel-rw

Copy link
Copy Markdown
Owner

I'm not sure whether I like this solution.
Would you mind that we wait until you looked into the lib?

@GoodOldJack12

Copy link
Copy Markdown
Contributor Author

We should look into it. But a provider returning an invalid result also shouldn't crash the app imo.
But there might be a more elegant way. I'm running it on my fork regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants