Skip to content

Commit b517ea2

Browse files
author
Rasmus Iversen
committed
Array of objects with oneOf prop
Fixing a bug where having `oneOf` prop on an object, in an array, causes json-forms.js to throw a hasOwnProperty of null exception. Code to reproduce: "resources": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "object", "oneOf": [ { "type": "array", "title": "External stylesheet", "items": { "type": "object", "properties": { "url": { "type": "string" } } } }, { "title": "Inline stylesheet", "type": "array", "items": { "type": "object", "properties": { "selector": { "type": "string" }, "css": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "required": true }, "value": { "type": "string", "required": true } } } } } } } ] } } } }
1 parent 22a9a9b commit b517ea2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/brutusin-json-forms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ if (typeof brutusin === "undefined") {
360360
option.value = s.oneOf[i];
361361
appendChild(option, textNode, s);
362362
appendChild(input, option, s);
363-
if (value === undefined)
363+
if (value === undefined || value === null)
364364
continue;
365365
if (s.readOnly)
366366
input.disabled = true;

0 commit comments

Comments
 (0)