Because programming is fun. After [32915], `_.find()` will return `undefined` if an empty array is passed - in that case, the function should return `true`.

See #32746.


git-svn-id: https://develop.svn.wordpress.org/trunk@32916 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-06-23 19:42:50 +00:00
parent 75b6e0755d
commit 7192f7e9cf
2 changed files with 2 additions and 2 deletions

View File

@ -900,7 +900,7 @@ var Attachments = Backbone.Collection.extend({
mime = atts.mime || ( atts.file && atts.file.type ) || '';
if ( _.isArray( type ) ) {
found = _.find( type, function (t) {
found = ! type.length || _.find( type, function (t) {
return -1 !== mime.indexOf( t );
} );
} else {

View File

@ -496,7 +496,7 @@ var Attachments = Backbone.Collection.extend({
mime = atts.mime || ( atts.file && atts.file.type ) || '';
if ( _.isArray( type ) ) {
found = _.find( type, function (t) {
found = ! type.length || _.find( type, function (t) {
return -1 !== mime.indexOf( t );
} );
} else {