Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 9057)
+++ trunk/ippTools/src/chiptool.c	(revision 9239)
@@ -246,6 +246,11 @@
     psArray *output = p_psDBFetchResult(config->dbh);
     if (!output) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+    if (!psArrayLength(output)) {
         // XXX check psError here
-        psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found");
+        psError(PS_ERR_UNKNOWN, false, "no p2PendingImfile rows found");
+        psFree(output);
         return false;
     }
@@ -375,9 +380,11 @@
     psArray *output = p_psDBFetchResult(config->dbh);
     if (!output) {
-        // XXX check psError here and decide if we need to rollback or commit
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+    if (!psArrayLength(output)) {
+        // XXX check psError here
         psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found");
-        // XXX temporarily returning true here as typically this wouldn't be a
-        // fatal error.  false should be returned once psError() is fixed
-        //return false;
+        psFree(output);
         return true;
     }
