@@ -248,14 +248,15 @@ export class NavControllerBase extends Ion implements NavController {
248
248
if ( ! ti ) {
249
249
return false ;
250
250
}
251
- // set that this nav is actively transitioning
252
- this . setTransitioning ( true ) ;
253
251
254
252
// Get entering and leaving views
255
253
const leavingView = this . getActive ( ) ;
256
254
const enteringView = this . _getEnteringView ( ti , leavingView ) ;
257
255
258
- assert ( leavingView || enteringView , 'Both leavingView and enteringView are null' ) ;
256
+ assert ( leavingView || enteringView , 'both leavingView and enteringView are null' ) ;
257
+
258
+ // set that this nav is actively transitioning
259
+ this . setTransitioning ( true ) ;
259
260
260
261
// Initialize enteringView
261
262
if ( enteringView && isBlank ( enteringView . _state ) ) {
@@ -328,6 +329,16 @@ export class NavControllerBase extends Ion implements NavController {
328
329
}
329
330
330
331
_postViewInit ( enteringView : ViewController , leavingView : ViewController , ti : TransitionInstruction , resolve : TransitionResolveFn ) {
332
+ assert ( leavingView || enteringView , 'Both leavingView and enteringView are null' ) ;
333
+
334
+ if ( ! enteringView && ! this . _isPortal ) {
335
+ console . warn ( `You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.` ,
336
+ this , this . getNativeElement ( ) ) ;
337
+
338
+ ti . reject && ti . reject ( 'navigation stack needs at least one root page' ) ;
339
+ return false ;
340
+ }
341
+
331
342
const opts = ti . opts || { } ;
332
343
const insertViews = ti . insertViews ;
333
344
const removeStart = ti . removeStart ;
0 commit comments