Index: /trunk/ippTools/src/p2searchPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6161)
+++ /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6162)
@@ -108,7 +108,17 @@
     }
 
+    if (where->list->n < 1) {
+        psFree(where);
+        where = NULL;
+    }
+
     psArray *imfiles = p2PendingImfileSelectRowObjects(config->database, where,
         MAX_ROWS);
     psFree(where);
+    if (!imfiles) {
+        psError(PS_ERR_UNKNOWN, false, "no rawScienceExp rows found");
+
+        return NULL;
+    }
 
     return imfiles;
