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

git-svn-id: http://core.svn.wordpress.org/trunk@23260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2013-01-04 07:08:37 +00:00
parent 1132f798f7
commit 774df9900e

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') );
},