                        providers/dbresult->provider)
           t (h/get-provider-collection-tablename provider)]
       (for [concept-id concept-ids
-            :let [result (j/query (config/db) [(format "select distinct entry_title from metadata_db.%s where concept_id = ?" t)
-                                               concept-id])]]
-        (:entry_title (first result))))))
+            :let [result (j/query (config/db) [(format "select distinct concept_id, entry_title from metadata_db.%s where concept_id = ?" t)
+                                               concept-id])]
+            :when (not (nil? concept-id))]
+        (first result)))))
 
 (defn up
   "Migrates the database up to version 57."

                       (util/gzip-blob->string)
                       (edn/read-string))
          {{:keys [collection-identifier collection-applicable granule-applicable provider-id]} :catalog-item-identity} metadata
          concept-ids (if (or collection-applicable granule-applicable)
                        (get-concept-ids provider-id collection-identifier)
                        nil)
          entry-titles (if (or collection-applicable granule-applicable)
                        (get-entry-titles provider-id collection-identifier)
                        nil)
          metadata (if deleted
                     metadata
                     (if (seq concept-ids)
                       (assoc-in metadata [:catalog-item-identity :collection-identifier :concept-ids] concept-ids)
                       metadata))
          metadata (if deleted
                     metadata
                     (if (seq entry-titles)
                       (assoc-in metadata [:catalog-item-identity :collection-identifier :entry-titles] entry-titles)
                       metadata))
          metadata (-> metadata
                       pr-str

                       providers/dbresult->provider)
          t (h/get-provider-collection-tablename provider)]
      (for [entry-title entry-titles
            :let [result (j/query (config/db) [(format "select distinct concept_id, entry_title from metadata_db.%s where entry_title = ?" t)
                                               entry-title])]
            :when (not (nil? entry-title))]
        (first result)))))

(defn- get-entry-titles
  "For a given provider and concept-ids in collection-identifier, returns list of collection entry-titles"
