From d0b28d7f596a94128c80ca5c9f0af4f5530c9e61 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 6 Feb 2026 15:41:00 +0000 Subject: [PATCH] Handle when location is null in image location JSON query --- db/sql/publicreport_image_with_json_by_nuisance_id.bob.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/sql/publicreport_image_with_json_by_nuisance_id.bob.sql b/db/sql/publicreport_image_with_json_by_nuisance_id.bob.sql index 032e63dd..bc70146f 100644 --- a/db/sql/publicreport_image_with_json_by_nuisance_id.bob.sql +++ b/db/sql/publicreport_image_with_json_by_nuisance_id.bob.sql @@ -7,7 +7,7 @@ SELECT "publicreport.image"."content_type" AS "content_type", "publicreport.image"."created" AS "created", "publicreport.image"."location" AS "location", - ST_AsGeoJSON("publicreport.image"."location") AS "location_json", + COALESCE(ST_AsGeoJSON("publicreport.image"."location"), '{}') AS "location_json", "publicreport.image"."resolution_x" AS "resolution_x", "publicreport.image"."resolution_y" AS "resolution_y", "publicreport.image"."storage_uuid" AS "storage_uuid",