Skip to content

Commit 8b63f28

Browse files
committed
don't allow indexes smaller than 0
1 parent 66bd0ad commit 8b63f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/fields/TextEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class UnconnectedTextEditor extends Component {
3232
if (index) {
3333
const adjustedIndex = parseInt(index[3], 10) - 1;
3434
if (!isNaN(adjustedIndex)) {
35-
return `%{meta[${adjustedIndex}]}`;
35+
return `%{meta[${adjustedIndex < 0 ? 0 : adjustedIndex}]}`;
3636
}
3737
}
3838
return match;

0 commit comments

Comments
 (0)