diff --git a/source/psychlua/ReflectionFunctions.hx b/source/psychlua/ReflectionFunctions.hx index 13b1adb6793..8c0dadf4a67 100644 --- a/source/psychlua/ReflectionFunctions.hx +++ b/source/psychlua/ReflectionFunctions.hx @@ -189,6 +189,7 @@ class ReflectionFunctions static function parseInstances(args:Array) { + if (args == null) return []; for (i in 0...args.length) { var myArg:String = cast args[i]; @@ -201,8 +202,8 @@ class ReflectionFunctions //trace('Op1: $myArg'); var lastIndex:Int = myArg.lastIndexOf('::'); - var split:Array = myArg.split('.'); - args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(0, lastIndex)) : PlayState.instance; + var split:Array = (lastIndex > -1) ? myArg.substring(0, lastIndex).split('.') : myArg.split('.'); + args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(lastIndex+2)) : PlayState.instance; for (j in 0...split.length) { //trace('Op2: ${Type.getClass(args[i])}, ${split[j]}');