Skip to content

Commit 95f7ccc

Browse files
committed
Don't assume feature has a crs field
1 parent 981b32f commit 95f7ccc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def post(self, dataset):
492492
if 'error' not in result:
493493
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', '{}'), request.files, translator, True)
494494
# Requery feature because the write_relation_values may change the feature through DB triggers
495-
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], feature['crs']['properties']['name'])
495+
result = data_service.show(get_identity(), translator, dataset, result['feature']['id'], feature.get('crs', {}).get('properties', {}).get('name'))
496496
if 'error' not in result:
497497
feature = result['feature']
498498
feature['relationValues'] = relationValues
@@ -543,7 +543,7 @@ def put(self, dataset, id):
543543
if 'error' not in result:
544544
relationValues = data_service.write_relation_values(get_identity(), result['feature']['id'], feature.get('relationValues', {}), request.files, translator)
545545
# Requery feature because the write_relation_values may change the feature through DB triggers
546-
result = data_service.show(get_identity(), translator, dataset, id, feature['crs']['properties']['name'])
546+
result = data_service.show(get_identity(), translator, dataset, id, feature.get('crs', {}).get('properties', {}).get('name'))
547547
if 'error' not in result:
548548
feature = result['feature']
549549
feature['relationValues'] = relationValues

0 commit comments

Comments
 (0)