Commit acefdbce authored by Kevin Stover's avatar Kevin Stover Committed by GitHub

Merge pull request #3252 from wpninjas/issue#3251

Fix form crash on unselected multi-select field
parents d5496192 77ec1a4a
......@@ -73,7 +73,9 @@ define([], function() {
* via custom user-meta ( a la User Mgmt add-on)
*/
if ( _.isArray( this.value ) ) {
if( 'listmultiselect' === this.type &&
// If we have a multiselect list...
// AND it has selected values...
if( 'listmultiselect' === this.type && 0 < this.value.length &&
-1 != _.indexOf( this.value[ 0 ].split( ',' ), option.value ) ) {
var selected = true;
} else if( -1 != _.indexOf( this.value, option.value ) ) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment