1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Allow script jobs to return object members directly if they are not functions

This commit is contained in:
Dominik Schmidt
2015-11-20 22:12:16 +01:00
parent f3c8038c42
commit 16946592b7

View File

@@ -778,7 +778,9 @@ Tomahawk.PluginManager = {
}
}
if (typeof this.objects[objectId][methodName] !== 'function') {
if (typeof this.objects[objectId][methodName] !== 'function' && this.objects[objectId][methodName]) {
return this.objects[objectId][methodName];
} else if (typeof this.objects[objectId][methodName] !== 'function') {
throw new Error('\'' + methodName + '\' on ScriptObject ' + objectId + ' is not a function', typeof this.objects[objectId][methodName]);
}