Commit fef57181 authored by Dan Poltawski's avatar Dan Poltawski
Browse files

MDL-57604 mod_assign: fix empty case in user selector

Sadly the js arguments object gives an arguments.length of 1 when
no arguments are passed, so we have to explicitly check for it.
parent 76bab368
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -95,8 +95,14 @@ define(['core/ajax', 'jquery', 'core/templates'], function(ajax, $, templates) {
// Do the dance for $.when()
return $.when.apply($, promises);
}).then(function() {
// Undo the $.when() dance from arguments object into an array..
var users = Array.prototype.slice.call(arguments);
var users = [];
// Determine if we've been passed any arguments..
if (arguments[0]) {
// Undo the $.when() dance from arguments object into an array..
users = Array.prototype.slice.call(arguments);
}
success(users);
}).catch(failure);
}
......
Supports Markdown
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