Skip to content

Commit 76f1f14

Browse files
committed
Check for function existence
1 parent caadc98 commit 76f1f14

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ var merge = function merge(schema, form, ignore, options, readonly) {
454454

455455
var stdForm = getDefaults(schema, ignore, options);
456456
// simple case, we have a "*", just put the stdForm there
457-
var idx = form.indexOf("*");
457+
var idx = form.indexOf && form.indexOf("*") || -1;
458458
if (idx !== -1) {
459459
form = form.slice(0, idx).concat(stdForm.form).concat(form.slice(idx + 1));
460460
}

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ const merge = (schema, form, ignore, options, readonly) => {
457457

458458
const stdForm = getDefaults(schema, ignore, options);
459459
// simple case, we have a "*", just put the stdForm there
460-
const idx = form.indexOf("*");
460+
const idx = form.indexOf && form.indexOf("*") || -1;
461461
if (idx !== -1) {
462462
form = form
463463
.slice(0, idx)

0 commit comments

Comments
 (0)