Index: /trunk/archive/psdb/psDB.c
===================================================================
--- /trunk/archive/psdb/psDB.c	(revision 3194)
+++ /trunk/archive/psdb/psDB.c	(revision 3195)
@@ -8,6 +8,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-11 21:46:13 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-11 21:52:33 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -873,4 +873,8 @@
     psMetadataItem  *item;
 
+    if (!where) {
+        return NULL;
+    }
+
     // init query with a psMemBlock
     query = psStringCopy("WHERE ");
@@ -1046,5 +1050,5 @@
 
     // select everything if where is NULL
-    if (!where) {
+    if (where) {
         psStringAppend(&query, " ");
 
