Merge pull request #2900 from tchak/fix-cart-selection-param

Fix old carto exception when no selection is passed
This commit is contained in:
gregoirenovel 2018-10-24 14:00:28 +02:00 committed by GitHub
commit 000d19b1f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ class Users::CarteController < UsersController
@dossier = current_user_dossier
@data = {}
geo_json = JSON.parse(params.required(:selection))
geo_json = JSON.parse(params.fetch(:selection, '[]'))
if geo_json.first == ["error", "TooManyPolygons"]
@error = true