Fixed potential JS error when copying product with empty but not null description

This commit is contained in:
Bernd Bestel
2022-06-04 13:32:31 +02:00
parent cd41c27ee1
commit 1ef64025c5

View File

@@ -471,7 +471,7 @@ if (Grocy.EditMode == "create" && GetUriParam("copy-of") != undefined)
{ {
Grocy.Components.ProductPicker.SetId(sourceProduct.parent_product_id); Grocy.Components.ProductPicker.SetId(sourceProduct.parent_product_id);
} }
if (sourceProduct.description != null) if (sourceProduct.description != null && !sourceProduct.description.isEmpty())
{ {
$("#description").summernote("pasteHTML", sourceProduct.description); $("#description").summernote("pasteHTML", sourceProduct.description);
} }