mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: Page and Frame isLoaded undefined checks (#6255)
* fix(view): isLoaded handling closes https://github.com/NativeScript/NativeScript/issues/6179 * refactor: Error handling code in onCreateView
This commit is contained in:
committed by
Dimitar Topuzov
parent
13d4f34c1b
commit
4a11cf907c
@@ -595,13 +595,13 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
}
|
||||
|
||||
public loadView(view: ViewBase): void {
|
||||
if (!view.isLoaded) {
|
||||
if (view && !view.isLoaded) {
|
||||
view.callLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
public unloadView(view: ViewBase): void {
|
||||
if (view.isLoaded) {
|
||||
if (view && view.isLoaded) {
|
||||
view.callUnloaded();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ function initializeDialogFragment() {
|
||||
}
|
||||
|
||||
const owner = this.owner;
|
||||
if (!owner.isLoaded) {
|
||||
if (owner && !owner.isLoaded) {
|
||||
owner.callLoaded();
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ function initializeDialogFragment() {
|
||||
}
|
||||
|
||||
const owner = this.owner;
|
||||
if (owner.isLoaded) {
|
||||
if (owner && owner.isLoaded) {
|
||||
owner.callUnloaded();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user