mirror of
https://github.com/moodle/moodle.git
synced 2025-07-24 07:41:40 +02:00
MDL-59784 core: Check for non-promises rather than string
If a malformed value was passed, it may be that we can still display it. We should not assume that, if a string is not passed, that we are dealing with a promise.
This commit is contained in:
@@ -608,7 +608,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
|
||||
*/
|
||||
Modal.prototype.asyncSet = function(value, setFunction) {
|
||||
var p = value;
|
||||
if (typeof value === 'string') {
|
||||
if (typeof value !== 'object' || !value.hasOwnProperty('then')) {
|
||||
p = $.Deferred();
|
||||
p.resolve(value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user