From fc1275566ee75773d726af19aeeb65b2682e0e23 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 22 May 2019 13:19:27 +0200 Subject: [PATCH] handle undefined realEstateType --- app/controllers/sizes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/sizes.js b/app/controllers/sizes.js index c4f252f..f13b0f7 100644 --- a/app/controllers/sizes.js +++ b/app/controllers/sizes.js @@ -10,7 +10,7 @@ const postSize = async (req, res) => { const realEstateType = getRealEstateTypeEnum(request.realEstateType); - const nextStep = realEstateType.hasGardenSize ? 'okucnica' : 'cijena'; + const nextStep = realEstateType && realEstateType.hasGardenSize ? 'okucnica' : 'cijena'; const nextStepPage = req.query.nextStep || nextStep; const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;