Skip to content

Commit

Permalink
Fix for Cannot read property 'replace' of null error by checking if f…
Browse files Browse the repository at this point in the history
…ield has value before replacing.
  • Loading branch information
drsdre authored and bissolli committed Jul 21, 2019
1 parent 217f058 commit 4a931ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
props: ['resource', 'resourceName', 'resourceId', 'field'],
computed: {
unmaskedValue() {
return this.field.value.replace(/\D/g, '');
return this.field.value ? this.field.value.replace(/\D/g, '') : '';
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/IndexField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
props: ['resourceName', 'field'],
computed: {
unmaskedValue() {
return this.field.value.replace(/\D/g, '');
return this.field.value ? this.field.value.replace(/\D/g, '') : '';
}
}
};
Expand Down

0 comments on commit 4a931ce

Please sign in to comment.