openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
660 stars 389 forks source link

fix: refactor + ignore 'null' product_type sent by app #11032

Closed stephanegigandet closed 1 day ago

stephanegigandet commented 1 day ago

I'm hoping this PR will fix https://github.com/openfoodfacts/smooth-app/issues/5864

If we receive product_type=null, we just ignore it.

Also refactored the code to remove some duplication.

sonarcloud[bot] commented 1 day ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

teolemon commented 8 hours ago