Skip to content

Commit c819466

Browse files
committed
fix: Prevent failing on null in case of empty form
1 parent 3e2e7d3 commit c819466

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/routes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default class IndexRoute extends Route {
205205
});
206206

207207
// Add N3 rules.
208-
rules.forEach((match) => {
208+
rules?.forEach((match) => {
209209
text += match;
210210
});
211211

@@ -220,7 +220,7 @@ export default class IndexRoute extends Route {
220220
}
221221

222222
async fillInFormWithSubmitEventPolicy(matches) {
223-
for (const rule of matches.rules) {
223+
for (const rule of matches?.rules || []) {
224224
const options = { blogic: false, outputType: 'string' };
225225
const query = `${
226226
matches.prefixes ? matches.prefixes.join('\n') : ''

0 commit comments

Comments
 (0)