From ff594fc6e9f18704456d794877302a0e3d7042cb Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Wed, 15 Jan 2020 22:48:13 -0600 Subject: [PATCH] productcard.js check null location --- public/viewjs/components/productcard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/viewjs/components/productcard.js b/public/viewjs/components/productcard.js index f181127f..defd3a80 100644 --- a/public/viewjs/components/productcard.js +++ b/public/viewjs/components/productcard.js @@ -15,7 +15,10 @@ Grocy.Components.ProductCard.Refresh = function(productId) $('#productcard-product-last-purchased-timeago').attr("datetime", productDetails.last_purchased || '2999-12-31'); $('#productcard-product-last-used').text((productDetails.last_used || '2999-12-31').substring(0, 10)); $('#productcard-product-last-used-timeago').attr("datetime", productDetails.last_used || '2999-12-31'); - $('#productcard-product-location').text(productDetails.location.name); + if (productDetails.location != null) + { + $('#productcard-product-location').text(productDetails.location.name); + } $('#productcard-product-spoil-rate').text((parseFloat(productDetails.spoil_rate_percent) / 100).toLocaleString(undefined, { style: "percent" })); if (productDetails.is_aggregated_amount == 1)