Skip to content

Commit 5ebf9d7

Browse files
committed
chore: adding type check when accessing a property
Signed-off-by: Pawel Psztyc <[email protected]>
1 parent e11aa9e commit 5ebf9d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/io/defaults/ThemeDefaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ export class ThemeDefaults {
209209
// version 0
210210
return this._upgradeInfoFile(file, data);
211211
}
212-
if (!(data.themes instanceof Array)) {
212+
if (!Array.isArray(data.themes)) {
213213
return this._copyInfoFile();
214214
}
215215
const item = data.themes[0];
216-
if (!item.location) {
216+
if (!item || !item.location) {
217217
return this._copyInfoFile();
218218
}
219219
if ((item.mainFile || '').indexOf('.js') !== -1) {

0 commit comments

Comments
 (0)