commit 5f113b1179129ef5f38c0fd286e79c220acfa494
Author: Chris Bush <christopher.bush@telvent.com>
Date:   Fri May 24 19:03:36 2013 -0400

    Fixed JobGenerator.java submit function for custom workspace and added error checking for JSON parsing

diff --git a/src/main/java/org/jenkinsci/plugins/jobgenerator/JobGenerator.java b/src/main/java/org/jenkinsci/plugins/jobgenerator/JobGenerator.java
index 221be9f..3f18e57 100755
--- a/src/main/java/org/jenkinsci/plugins/jobgenerator/JobGenerator.java
+++ b/src/main/java/org/jenkinsci/plugins/jobgenerator/JobGenerator.java
@@ -194,15 +194,28 @@ public class JobGenerator extends Project<JobGenerator, GeneratorRun>
             throws IOException, ServletException, FormException {
         super.submit(req, rsp);
         JSONObject json = req.getSubmittedForm();
-        JSONObject o = json.getJSONObject(
-                                     "plugin-jobgenerator-GeneratedJobConfig");
-        if(o != null) {
-            String k = "generatedJobName";
-            if(o.has(k)){ this.generatedJobName = o.getString(k); }
-            k = "generatedDisplayJobName";
-            if(o.has(k)){ this.generatedDisplayJobName = o.getString(k); }
-            k = "customWorkspace";
-            if(o.has(k)) {this.customWorkspace = o.getString(k);}
+        
+        String k = "plugin-jobgenerator-GeneratedJobConfig";
+        JSONObject o;
+        
+        if(json.has(k)){        
+            o = json.getJSONObject(k);
+            if(o != null) {
+                k = "generatedJobName";
+                if(o.has(k)){ this.generatedJobName = o.getString(k); }
+                k = "generatedDisplayJobName";
+                if(o.has(k)){ this.generatedDisplayJobName = o.getString(k); }            
+            }
+        }
+        
+        this.customWorkspace = null;
+        k = "customWorkspace";
+        if(json.has(k)){
+            o = json.getJSONObject(k);
+            if(o != null){
+                k = "directory";
+                if(o.has(k)) { this.customWorkspace = o.getString(k); }
+            }
         }
     }
 
