Media: Check that a router region exists before attempting to access its child views. Add relevant documentation. see #22930.

git-svn-id: https://develop.svn.wordpress.org/trunk@23260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2013-01-04 07:08:37 +00:00
parent 45d01dad51
commit 2b5612e266
1 changed files with 4 additions and 1 deletions

View File

@ -522,7 +522,10 @@
router = frame.router.get(),
mode = frame.content.mode();
if ( this.active && ! selection.length && ! router.get( mode ) )
// If the state is active, no items are selected, and the current
// content mode is not an option in the state's router (provided
// the state has a router), reset the content mode to the default.
if ( this.active && ! selection.length && router && ! router.get( mode ) )
this.frame.content.render( this.get('content') );
},