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 {
58
58
}
59
59
}
60
60
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
+ }
62
66
let nCoordinatorLayout : androidx . coordinatorlayout . widget . CoordinatorLayout = ( page as any ) . nCoordinatorLayout ;
63
67
if ( ! nCoordinatorLayout && ! ( nView instanceof androidx . coordinatorlayout . widget . CoordinatorLayout ) && nView instanceof android . view . ViewGroup ) {
64
68
nCoordinatorLayout = new androidx . coordinatorlayout . widget . CoordinatorLayout ( attachView . _context ) ;
You can’t perform that action at this time.
0 commit comments