| 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 | |
|---|---|---|---|
@@ -180,7 +180,7 @@ function initializeDialogFragment() { | |||
| 180 | 180 | } | |
| 181 | 181 | ||
| 182 | 182 | const owner = this.owner; | |
| 183 | - if (!owner.isLoaded) { | ||
| 183 | + if (owner && !owner.isLoaded) { | ||
| 184 | 184 | owner.callLoaded(); | |
| 185 | 185 | } | |
| 186 | 186 | ||
@@ -196,7 +196,7 @@ function initializeDialogFragment() { | |||
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | 198 | const owner = this.owner; | |
| 199 | - if (owner.isLoaded) { | ||
| 199 | + if (owner && owner.isLoaded) { | ||
| 200 | 200 | owner.callUnloaded(); | |
| 201 | 201 | } | |
| 202 | 202 | } | |
| 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 { | |
@@ -696,8 +696,23 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 696 | 696 | } | |
| 697 | 697 | ||
| 698 | 698 | const entry = this.entry; | |
| 699 | + if (!entry) { | ||
| 700 | + traceError(`${fragment}.onCreateView: entry is null or undefined`); | ||
| 701 | + return null; | ||
| 702 | + } | ||
| 703 | + | ||
| 699 | 704 | const page = entry.resolvedPage; | |
| 705 | + if (!page) { | ||
| 706 | + traceError(`${fragment}.onCreateView: entry has no resolvedPage`); | ||
| 707 | + return null; | ||
| 708 | + } | ||
| 709 | + | ||
| 700 | 710 | const frame = this.frame; | |
| 711 | + if (!frame) { | ||
| 712 | + traceError(`${fragment}.onCreateView: this.frame is null or undefined`); | ||
| 713 | + return null; | ||
| 714 | + } | ||
| 715 | + | ||
| 701 | 716 | if (page.parent === frame) { | |
| 702 | 717 | // If we are navigating to a page that was destroyed | |
| 703 | 718 | // reinitialize its UI. | |
@@ -706,12 +721,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 706 | 721 | page._setupUI(context); | |
| 707 | 722 | } | |
| 708 | 723 | } else { | |
| 709 | - if (!this.frame._styleScope) { | ||
| 724 | + if (!frame._styleScope) { | ||
| 710 | 725 | // Make sure page will have styleScope even if parents don't. | |
| 711 | 726 | page._updateStyleScope(); | |
| 712 | 727 | } | |
| 713 | 728 | ||
| 714 | - this.frame._addView(page); | ||
| 729 | + frame._addView(page); | ||
| 715 | 730 | } | |
| 716 | 731 | ||
| 717 | 732 | if (frame.isLoaded && !page.isLoaded) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -357,7 +357,7 @@ export class CssState { | |||
| 357 | 357 | * As a result, at some point in time, the selectors matched have to be requerried from the style scope and applied to the view. | |
| 358 | 358 | */ | |
| 359 | 359 | public onChange(): void { | |
| 360 | - if (this.view.isLoaded) { | ||
| 360 | + if (this.view && this.view.isLoaded) { | ||
| 361 | 361 | this.unsubscribeFromDynamicUpdates(); | |
| 362 | 362 | this.updateMatch(); | |
| 363 | 363 | this.subscribeForDynamicUpdates(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments