Index: trunk/ippTools/src/pxchip.c
===================================================================
--- trunk/ippTools/src/pxchip.c	(revision 24335)
+++ trunk/ippTools/src/pxchip.c	(revision 24371)
@@ -175,5 +175,5 @@
     psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET state = '%s'");
 
-    if (where) {
+    if (where && psListLength(where->list) > 0) {
         psString whereClause = psDBGenerateWhereSQL(where, NULL);
         psStringAppend(&query, " %s", whereClause);
@@ -216,5 +216,5 @@
     psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) SET label = '%s'");
 
-    if (where) {
+    if (where && psListLength(where->list) > 0) {
         psString whereClause = psDBGenerateWhereSQL(where, NULL);
         psStringAppend(&query, " %s", whereClause);
@@ -264,5 +264,5 @@
             dvodb,
             tess_id,
-            end_stage, 
+            end_stage,
             0           // magicked
             )
@@ -277,5 +277,5 @@
     psS64 chip_id =  psDBLastInsertID(config->dbh);
 
-    // Create rows in chipImfile table for each input exposure. 
+    // Create rows in chipImfile table for each input exposure.
     // This creates the chip_image_id values
     psString query = "INSERT INTO chipImfile "
@@ -295,5 +295,5 @@
         return 0;
     }
-    
+
     return chip_id;
 }
