|
1 | 1 | import { tagName } from '@ember-decorators/component'; |
2 | 2 | import Component from '@ember/component'; |
3 | | -import { assert } from '@ember/debug'; |
4 | 3 | import { action, computed } from '@ember/object'; |
5 | 4 | import { alias, or } from '@ember/object/computed'; |
6 | 5 | import { inject as service } from '@ember/service'; |
@@ -130,19 +129,19 @@ export default class FilesManagerComponent extends Component { |
130 | 129 |
|
131 | 130 | @task({ withTestWaiter: true, restartable: true, on: 'didReceiveAttrs' }) |
132 | 131 | getRootItems = task(function *(this: FilesManagerComponent) { |
133 | | - assert('@node is required', Boolean(this.node)); |
134 | | - |
135 | | - const fileProviders = yield this.node.files; |
136 | | - const fileProvider = fileProviders.findBy('name', 'osfstorage') as FileProvider; |
137 | | - const rootFolder = yield fileProvider.rootFolder; |
138 | | - |
139 | | - yield rootFolder.files; |
140 | | - |
141 | | - this.setProperties({ |
142 | | - fileProvider, |
143 | | - rootFolder, |
144 | | - currentFolder: rootFolder, |
145 | | - }); |
| 132 | + if (this.node) { |
| 133 | + const fileProviders = yield this.node.files; |
| 134 | + const fileProvider = fileProviders.findBy('name', 'osfstorage') as FileProvider; |
| 135 | + const rootFolder = yield fileProvider.rootFolder; |
| 136 | + |
| 137 | + yield rootFolder.files; |
| 138 | + |
| 139 | + this.setProperties({ |
| 140 | + fileProvider, |
| 141 | + rootFolder, |
| 142 | + currentFolder: rootFolder, |
| 143 | + }); |
| 144 | + } |
146 | 145 | }); |
147 | 146 |
|
148 | 147 | @task({ withTestWaiter: true }) |
|
0 commit comments