Fix sentry errors in old carto module
This commit is contained in:
parent
f75d890a1f
commit
e5d8d351ba
2 changed files with 8 additions and 4 deletions
|
@ -65,9 +65,13 @@ class Users::CarteController < UsersController
|
|||
# https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
if json_latlngs.present?
|
||||
multipolygone = JSON.parse(json_latlngs)
|
||||
multipolygone.reject! { |polygone| polygone.count < 4 }
|
||||
if multipolygone.present?
|
||||
multipolygone.to_json
|
||||
if multipolygone.first == ["error", "TooManyPolygons"]
|
||||
[].to_json
|
||||
else
|
||||
multipolygone.reject! { |polygone| polygone.count < 4 }
|
||||
if multipolygone.present?
|
||||
multipolygone.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue