diff --git a/changelog/69_UNRELEASED_xxxx-xx-xx.md b/changelog/69_UNRELEASED_xxxx-xx-xx.md index 9d9fb348..88ad6ad6 100644 --- a/changelog/69_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/69_UNRELEASED_xxxx-xx-xx.md @@ -46,7 +46,7 @@ ### Userfields -- xxx +- Fixed that edit forms were broken when editing an object with `null` Userfields (so when the field for that object was not set before / on the initial object creation) ### General diff --git a/public/viewjs/components/userfieldsform.js b/public/viewjs/components/userfieldsform.js index 0691ca36..a315ac6c 100644 --- a/public/viewjs/components/userfieldsform.js +++ b/public/viewjs/components/userfieldsform.js @@ -178,7 +178,7 @@ Grocy.Components.UserfieldsForm.Load = function() } else if (input.attr("data-userfield-type") == "link") { - if (!value.isEmpty()) + if (value != null && !value.isEmpty()) { var data = JSON.parse(value);