Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 266378f

Browse files
committed
fix bug
1 parent ae292c9 commit 266378f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/InertiaForm.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ class InertiaForm {
197197

198198
errors(field = null) {
199199
if (field === null) {
200-
return Object.values(this.inertiaPage().errorBags[this.__options.bag])
201-
.reduce((a, b) => a.concat(b), []);
200+
return this.hasErrors()
201+
? Object.values(this.inertiaPage().errorBags[this.__options.bag])
202+
.reduce((a, b) => a.concat(b), [])
203+
: [];
202204
}
203205

204206
return this.error(field)

0 commit comments

Comments
 (0)