From a5017f218fe68fbfb05cfef9e85214b198ed8f0b Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Mon, 13 Sep 2010 22:15:50 +0200 Subject: [PATCH] Fix mean nasal bug when calling setprop("foo") Reported on the forum from Thorsten Renk and analyzed by Hooray, fixes this issue: var x="/test/X"; var y="/test/Y"; setprop(x,100); # sets x=100 setprop(y); # sets x=0 setprop(x,100); setprop(200); # sets x=200 by checking for at least 2 parameters for setprop --- src/Scripting/NasalSys.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 0a221fc6e..ae5d9c0af 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -212,6 +212,7 @@ static naRef f_setprop(naContext c, naRef me, int argc, naRef* args) buf[BUFLEN] = 0; char* p = buf; int buflen = BUFLEN; + if(argc < 2) naRuntimeError(c, "setprop() expects at least 2 arguments"); for(int i=0; i