File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -341,12 +341,13 @@ export class NavControllerBase extends Ion implements NavController {
341
341
return convertToViews ( this . _linker , insertViews ) . then ( ( viewControllers ) => {
342
342
assert ( insertViews . length === viewControllers . length , 'lengths does not match' ) ;
343
343
344
+ viewControllers = viewControllers . filter ( v => v !== null ) ;
345
+ if ( viewControllers . length === 0 ) {
346
+ throw 'invalid views to insert' ;
347
+ }
344
348
// Check all the inserted view are correct
345
349
for ( var i = 0 ; i < viewControllers . length ; i ++ ) {
346
350
var view = viewControllers [ i ] ;
347
- if ( ! view ) {
348
- throw 'invalid views to insert' ;
349
- }
350
351
var nav = view . _nav ;
351
352
if ( nav && nav !== this ) {
352
353
throw 'inserted view was already inserted' ;
You can’t perform that action at this time.
0 commit comments