       (when (#{"csv" "shp"} sample-distribution)
         ;; FIXME, Create a copy of external sample so they can be restored.
         (log "Restoring external samples for user drawn samples is temporarily broken"))
-      (let [bad-plots (map :visible_id (call-sql "plots_missing_samples" project-id))]
-        (when (seq bad-plots)
-          (init-throw (str "The uploaded plot and sample files do not have correctly overlapping data. "
-                           (count bad-plots)
-                           " plots have no samples. The first 10 PLOTIDs are: ["
-                           (str/join ", " (take 10 bad-plots))
-                           "]")))))))
+      (when-let [bad-plots (seq (map :visible_id (call-sql "plots_missing_samples" project-id)))]
+        (init-throw (str "The uploaded plot and sample files do not have correctly overlapping data. "
+                         (count bad-plots)
+                         " plots have no samples. The first 10 PLOTIDs are: ["
+                         (str/join ", " (take 10 bad-plots))
+                         "]"))))))
 
 (defn- create-project-plots! [project-id
                               lon-min

                                                 folder-name
                                                 (str "project-" project-id "-" design-type))]
      (try-catch-throw #(let [[headers body] (get-file-data distribution design-type saved-file folder-name)]
                          (when-not (seq? body)
                            (init-throw (str "The " design-type " file contains no rows of data.")))

                          (check-headers headers primary-key design-type)

       (remove #(= folder-name %))
       (filter #(= ext (peek (str/split % #"\."))))
       (first)))

(defn- parse-as-sh-cmd
  "Split string into an array for use with clojure.java.shell/sh."
