                                         postgres/xml-tree-values :path path)))
                         first
                         :value)]
-    (if (str/blank? source-name)
+    (if source-name
+      ctx
       (update-in ctx [:fatal :source path :missing]
-                 conj :missing-name)
-      ctx)))
+                 conj :missing-name))))
 
 (defn validate-date-time [{:keys [import-id] :as ctx}]
   (let [path "VipObject.0.Source.*{1}.DateTime.*{1}"

(ns vip.data-processor.validation.v5.source
  (:require [korma.core :as korma]
            [vip.data-processor.db.postgres :as postgres]
            [clojure.string :as str]))

(defn validate-one-source [{:keys [import-id] :as ctx}]
  (let [result (korma/exec-raw

                                             postgres/xml-tree-values :path path)))
                             first
                             :value)]
    (if source-date-time
      ctx
      (update-in ctx [:fatal :source path :missing]
                 conj :missing-date-time))))
