src/myams/resources/js/myams-require.js
changeset 43 84a34175f37c
parent 39 fed67f169e1c
--- a/src/myams/resources/js/myams-require.js	Fri Jan 29 13:26:38 2021 +0100
+++ b/src/myams/resources/js/myams-require.js	Fri Jan 29 13:26:53 2021 +0100
@@ -319,12 +319,12 @@
 	 * Get an object given by name
 	 */
 	MyAMS.getObject = function (objectName, context) {
+		if (typeof(objectName) !== 'string') {
+			return objectName;
+		}
 		if (!objectName) {
 			return undefined;
 		}
-		if (typeof(objectName) !== 'string') {
-			return objectName;
-		}
 		var namespaces = objectName.split(".");
 		context = (context === undefined || context === null) ? window : context;
 		for (var i = 0; i < namespaces.length; i++) {
@@ -342,10 +342,11 @@
 	 * Small piece of code by Jason Bunting
 	 */
 	MyAMS.getFunctionByName = function (functionName, context) {
-		if (functionName === undefined) {
+		if (typeof(functionName) === 'function') {
+			return functionName;
+		}
+		if (!functionName) {
 			return undefined;
-		} else if (typeof(functionName) === 'function') {
-			return functionName;
 		}
 		var namespaces = functionName.split(".");
 		var func = namespaces.pop();