[ACA-4205] safety checks to avoid crashes in doclist (#6432)

* safety checks to avoid crashes in doclist

* reduce shared state in tests

* fix test
This commit is contained in:
Denys Vuika
2020-12-07 16:15:48 +00:00
committed by GitHub
parent c45a9c4489
commit 751ca03975
2 changed files with 56 additions and 50 deletions

View File

@@ -501,7 +501,9 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
this.ngZone.run(() => {
this.resetSelection();
if (this.node) {
this.data.loadPage(this.node, this._pagination.merge, null, this.getPreselectNodesBasedOnSelectionMode());
if (this.data) {
this.data.loadPage(this.node, this._pagination.merge, null, this.getPreselectNodesBasedOnSelectionMode());
}
this.onPreselectNodes();
this.syncPagination();
this.onDataReady(this.node);
@@ -698,7 +700,9 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
onPageLoaded(nodePaging: NodePaging) {
if (nodePaging) {
this.data.loadPage(nodePaging, this._pagination.merge, this.allowDropFiles, this.getPreselectNodesBasedOnSelectionMode());
if (this.data) {
this.data.loadPage(nodePaging, this._pagination.merge, this.allowDropFiles, this.getPreselectNodesBasedOnSelectionMode());
}
this.onPreselectNodes();
this.setLoadingState(false);
this.onDataReady(nodePaging);