File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ export class SnackBar extends SnackBarBase {
5858 }
5959 }
6060 const page = ( attachView instanceof Page ? attachView : attachView . page ) || attachView ;
61- let nView = page instanceof Page ? ( page . nativeViewProtected as android . view . View ) . getParent ( ) : attachView . nativeViewProtected ;
61+ let nView = page instanceof Page ? ( page . nativeViewProtected as android . view . View ) ?. getParent ( ) : attachView . nativeViewProtected ;
62+ if ( ! nView ) {
63+ console . warn ( `the snackbar parent ${ page } is not loaded` ) ;
64+ return ;
65+ }
6266 let nCoordinatorLayout : androidx . coordinatorlayout . widget . CoordinatorLayout = ( page as any ) . nCoordinatorLayout ;
6367 if ( ! nCoordinatorLayout && ! ( nView instanceof androidx . coordinatorlayout . widget . CoordinatorLayout ) && nView instanceof android . view . ViewGroup ) {
6468 nCoordinatorLayout = new androidx . coordinatorlayout . widget . CoordinatorLayout ( attachView . _context ) ;
You can’t perform that action at this time.
0 commit comments