Index: trunk/ippTools/src/dettool.c
===================================================================
--- trunk/ippTools/src/dettool.c	(revision 7302)
+++ trunk/ippTools/src/dettool.c	(revision 7304)
@@ -749,4 +749,8 @@
         return false;
     }
+    if (!det_id) {
+        psError(PS_ERR_UNKNOWN, true, "-det_id is required");
+        return false;
+    }
     psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
     if (!status) {
@@ -754,4 +758,8 @@
         return false;
     }
+    if (!class_id) {
+        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
+        return false;
+    }
     psString uri    = psMetadataLookupStr(&status, config->args, "-uri");
     if (!status) {
@@ -759,4 +767,17 @@
         return false;
     }
+    if (!uri) {
+        psError(PS_ERR_UNKNOWN, true, "-uri is required");
+        return false;
+    }
+    psString stats = psMetadataLookupStr(&status, config->args, "-stats");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stats");
+        return false;
+    }
+    if (!stats) {
+        psError(PS_ERR_UNKNOWN, true, "-stats is required");
+        return false;
+    }
     psString recipe = psMetadataLookupStr(&status, config->args, "-recipe");
     if (!status) {
@@ -764,7 +785,6 @@
         return false;
     }
-    psString stats = psMetadataLookupStr(&status, config->args, "-stats");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -stats");
+    if (!recipe) {
+        psError(PS_ERR_UNKNOWN, true, "-recipe is required");
         return false;
     }
@@ -879,6 +899,17 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
+    // XXX det_id is requried as a simplification
+    bool status = false;
+    psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");
+        return false;
+    }
+    if (!det_id) {
+        psError(PS_ERR_UNKNOWN, true, "-det_id is required");
+        return false;
+    }
+
     // find all detStackedImfile for det_id
-    // XXX det_id is requried as a simplification
     psArray *stackedImfiles =
         detStackedImfileSelectRowObjects(config->dbh, config->where, 0);
@@ -889,13 +920,4 @@
 
     // find all class_ids for the det_id's associated detInputExps
-    // find detInputExps in det_id
-    bool status = false;
-    psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");
-        psFree(stackedImfiles);
-        return false;
-    }
-
     psArray *valid_class_ids = validDetInputClassIds(config, det_id);
     if (!valid_class_ids) {
