Ensure that Main.overview._overview exists before accessing it.

This commit is contained in:
Bruce Leidl 2021-12-13 11:30:43 -05:00
parent c93e5e6431
commit 7d08587000

View File

@ -33,10 +33,14 @@ var RealmManager = class {
this._switchAnimation = new RealmSwitcher.ContextSwitchAnimationController(this._realmIndicator);
this._searchResults = Main.overview._overview.controls._searchController._searchResults;
this._searchProvider = new RealmSearchProvider.RealmSearchProvider();
this._searchProvider.createResultDisplay(this._searchResults);
this._searchResults._registerProvider(this._searchProvider);
if (Main.overview._overview) {
this._searchResults = Main.overview._overview.controls._searchController._searchResults;
this._searchProvider = new RealmSearchProvider.RealmSearchProvider();
this._searchProvider.createResultDisplay(this._searchResults);
this._searchResults._registerProvider(this._searchProvider);
} else {
log("Not creating search provider because Main.overview._overview does not exist");
}
this._frameManager = new RealmWindowFrame.WindowFrameManager();
}