| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -595,13 +595,13 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition | |||
| 595 | 595 | } | |
| 596 | 596 | ||
| 597 | 597 | public loadView(view: ViewBase): void { | |
| 598 | - if (!view.isLoaded) { | ||
| 598 | + if (view && !view.isLoaded) { | ||
| 599 | 599 | view.callLoaded(); | |
| 600 | 600 | } | |
| 601 | 601 | } | |
| 602 | 602 | ||
| 603 | 603 | public unloadView(view: ViewBase): void { | |
| 604 | - if (view.isLoaded) { | ||
| 604 | + if (view && view.isLoaded) { | ||
| 605 | 605 | view.callUnloaded(); | |
| 606 | 606 | } | |
| 607 | 607 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,7 +185,7 @@ function initializeDialogFragment() { | |||
| 185 | 185 | } | |
| 186 | 186 | ||
| 187 | 187 | const owner = this.owner; | |
| 188 | - if (!owner.isLoaded) { | ||
| 188 | + if (owner && !owner.isLoaded) { | ||
| 189 | 189 | owner.callLoaded(); | |
| 190 | 190 | } | |
| 191 | 191 | ||
@@ -201,7 +201,7 @@ function initializeDialogFragment() { | |||
| 201 | 201 | } | |
| 202 | 202 | ||
| 203 | 203 | const owner = this.owner; | |
| 204 | - if (owner.isLoaded) { | ||
| 204 | + if (owner && owner.isLoaded) { | ||
| 205 | 205 | owner.callUnloaded(); | |
| 206 | 206 | } | |
| 207 | 207 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ import { Page } from "../page"; | |||
| 9 | 9 | import * as application from "../../application"; | |
| 10 | 10 | import { | |
| 11 | 11 | FrameBase, stack, goBack, View, Observable, | |
| 12 | - traceEnabled, traceWrite, traceCategories | ||
| 12 | + traceEnabled, traceWrite, traceCategories, traceError | ||
| 13 | 13 | } from "./frame-common"; | |
| 14 | 14 | ||
| 15 | 15 | import { | |
@@ -720,8 +720,23 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 720 | 720 | } | |
| 721 | 721 | ||
| 722 | 722 | const entry = this.entry; | |
| 723 | + if (!entry) { | ||
| 724 | + traceError(`${fragment}.onCreateView: entry is null or undefined`); | ||
| 725 | + return null; | ||
| 726 | + } | ||
| 727 | + | ||
| 723 | 728 | const page = entry.resolvedPage; | |
| 729 | + if (!page) { | ||
| 730 | + traceError(`${fragment}.onCreateView: entry has no resolvedPage`); | ||
| 731 | + return null; | ||
| 732 | + } | ||
| 733 | + | ||
| 724 | 734 | const frame = this.frame; | |
| 735 | + if (!frame) { | ||
| 736 | + traceError(`${fragment}.onCreateView: this.frame is null or undefined`); | ||
| 737 | + return null; | ||
| 738 | + } | ||
| 739 | + | ||
| 725 | 740 | if (page.parent === frame) { | |
| 726 | 741 | // If we are navigating to a page that was destroyed | |
| 727 | 742 | // reinitialize its UI. | |
@@ -730,12 +745,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 730 | 745 | page._setupUI(context); | |
| 731 | 746 | } | |
| 732 | 747 | } else { | |
| 733 | - if (!this.frame._styleScope) { | ||
| 748 | + if (!frame._styleScope) { | ||
| 734 | 749 | // Make sure page will have styleScope even if parents don't. | |
| 735 | 750 | page._updateStyleScope(); | |
| 736 | 751 | } | |
| 737 | 752 | ||
| 738 | - this.frame._addView(page); | ||
| 753 | + frame._addView(page); | ||
| 739 | 754 | } | |
| 740 | 755 | ||
| 741 | 756 | if (frame.isLoaded && !page.isLoaded) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -328,7 +328,7 @@ export class CssState { | |||
| 328 | 328 | * As a result, at some point in time, the selectors matched have to be requerried from the style scope and applied to the view. | |
| 329 | 329 | */ | |
| 330 | 330 | public onChange(): void { | |
| 331 | - if (this.view.isLoaded) { | ||
| 331 | + if (this.view && this.view.isLoaded) { | ||
| 332 | 332 | this.unsubscribeFromDynamicUpdates(); | |
| 333 | 333 | this.updateMatch(); | |
| 334 | 334 | this.subscribeForDynamicUpdates(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments