Index: trunk/psModules/src/detrend/pmDetrendDB.c
===================================================================
--- trunk/psModules/src/detrend/pmDetrendDB.c	(revision 15911)
+++ trunk/psModules/src/detrend/pmDetrendDB.c	(revision 16611)
@@ -115,5 +115,4 @@
     PS_ASSERT_PTR_NON_NULL(options, NULL);
     PS_ASSERT_PTR_NON_NULL(config, NULL);
-    PS_ASSERT_PTR_NON_NULL(config->site, NULL);
 
     int status, exit_status;
@@ -150,7 +149,15 @@
         psStringAppend(&line, " -airmass %f", options->twilight);
     }
-
-    pmConfigDatabaseCommand(&line, config);
-    pmConfigTraceCommand(&line);
+    
+    if (!pmConfigDatabaseCommand(&line, config)) {
+        psError (PS_ERR_IO, false, "error building detrend command %s", line);
+        goto failure;
+    }
+
+    if (!pmConfigTraceCommand(&line)) {
+        psError (PS_ERR_IO, false, "error building detrend command %s", line);
+        goto failure;
+    }
+
     psTrace("psModules.detrend", 5, "running %s", line);
 
