Revision: 4051
          http://vexi.svn.sourceforge.net/vexi/?rev=4051&view=rev
Author:   clrg
Date:     2011-03-16 12:08:13 +0000 (Wed, 16 Mar 2011)

Log Message:
-----------
Fix #42 - non-function puts to vexi.thread causing NPE in Interpreter

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Vexi.jpp

Modified: trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Vexi.jpp
===================================================================
--- trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Vexi.jpp        
2011-03-16 01:34:53 UTC (rev 4050)
+++ trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Vexi.jpp        
2011-03-16 12:08:13 UTC (rev 4051)
@@ -635,7 +635,11 @@
     public void put(JS name, JS value) throws JSExn {
         //#switch(JSU.toString(name))
         case "thread":
-            Main.SCHEDULER.runInNew(value,null);
+            if (!(value instanceof JSFunction)) {
+                // sanity check so we are not passing nonsensical arguments to 
the scheduler
+                throw new JSExn("Tried to put non-function value of type 
'"+(value==null?"null":value.type())+"' to vexi.thread");
+            }
+            Main.SCHEDULER.runInNew(value, null);
             return;
         case "debug":
             Main.debug = JSU.toBoolean(value);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to