@@ -9,7 +9,7 @@ import { Page } from "../page";
99import * as application from "../../application" ;
1010import {
1111 FrameBase , stack , goBack , View , Observable ,
12- traceEnabled , traceWrite , traceCategories
12+ traceEnabled , traceWrite , traceCategories , traceError
1313} from "./frame-common" ;
1414
1515import {
@@ -720,8 +720,23 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
720720 }
721721
722722 const entry = this . entry ;
723+ if ( ! entry ) {
724+ traceError ( `${ fragment } .onCreateView: entry is null or undefined` ) ;
725+ return null ;
726+ }
727+
723728 const page = entry . resolvedPage ;
729+ if ( ! page ) {
730+ traceError ( `${ fragment } .onCreateView: entry has no resolvedPage` ) ;
731+ return null ;
732+ }
733+
724734 const frame = this . frame ;
735+ if ( ! frame ) {
736+ traceError ( `${ fragment } .onCreateView: this.frame is null or undefined` ) ;
737+ return null ;
738+ }
739+
725740 if ( page . parent === frame ) {
726741 // If we are navigating to a page that was destroyed
727742 // reinitialize its UI.
@@ -730,12 +745,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
730745 page . _setupUI ( context ) ;
731746 }
732747 } else {
733- if ( ! this . frame . _styleScope ) {
748+ if ( ! frame . _styleScope ) {
734749 // Make sure page will have styleScope even if parents don't.
735750 page . _updateStyleScope ( ) ;
736751 }
737752
738- this . frame . _addView ( page ) ;
753+ frame . _addView ( page ) ;
739754 }
740755
741756 if ( frame . isLoaded && ! page . isLoaded ) {
0 commit comments