Commit e6cfb91
authored
Fix ts error for potentially undefined newFileName (#1564)
## Purpose
We had a ts error on build that wasn't caught by eslint. Apparently we were too clever with an if statement, and had to be more explicit.
```
lib/osf-components/addon/components/file-browser/file-rename-modal/component.ts:31:46 - error TS2532: Object is possibly 'undefined'.
31 return (Boolean(this.newFileName) && this.newFileName.trim() !== this.originalFileName &&
~~~~~~~~~~~~~~~~
lib/osf-components/addon/components/file-browser/file-rename-modal/component.ts:32:13 - error TS2532: Object is possibly 'undefined'.
32 this.newFileName.trim() !== '');
~~~~~~~~~~~~~~~~
```
## Summary of Changes
1. Wrap return in an if statement to check for the existence of newFileName1 parent db99566 commit e6cfb91
File tree
1 file changed
+4
-2
lines changed- lib/osf-components/addon/components/file-browser/file-rename-modal
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
0 commit comments