File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
packages/property-base/src Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,13 @@ export const getResidenceSizeByRentalId = async (rentalId: string) => {
195195 } ,
196196 } )
197197
198+ if ( propertyInfo === null ) {
199+ logger . warn (
200+ 'residence-adapter.getResidenceSizeByRentalId: No property structure found for rentalId'
201+ )
202+ return null
203+ }
204+
198205 // Get area size for the property object
199206 const areaSize = await prisma . quantityValue . findFirst ( {
200207 where : {
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ export const routes = (router: KoaRouter) => {
243243 : null
244244
245245 // Get area size for the residence (yta)
246- const size = await getResidenceSizeByRentalId ( rentalId )
246+ const size = rentalId ? await getResidenceSizeByRentalId ( rentalId ) : null
247247
248248 const mappedResidence = {
249249 id : residence . id ,
You can’t perform that action at this time.
0 commit comments