From 40443e77a43900c90250d26c6a93c972a679acf8 Mon Sep 17 00:00:00 2001
From: Allen Gilliland <agilliland@gmail.com>
Date: Wed, 11 Nov 2015 11:50:26 -0800
Subject: [PATCH] avoid trying to set the admin email to nil in data migration.

---
 src/metabase/db/migrations.clj | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/metabase/db/migrations.clj b/src/metabase/db/migrations.clj
index 15ecc79ad94..a4460fc3035 100644
--- a/src/metabase/db/migrations.clj
+++ b/src/metabase/db/migrations.clj
@@ -85,4 +85,5 @@
 ;; Populate the initial value for the `:admin-email` setting for anyone who hasn't done it yet
 (defmigration set-admin-email
   (when-not (setting/get :admin-email)
-    (setting/set :admin-email (db/sel :one :field ['User :email] (k/where {:is_superuser true :is_active true})))))
+    (when-let [email (db/sel :one :field ['User :email] (k/where {:is_superuser true :is_active true}))]
+      (setting/set :admin-email email))))
-- 
GitLab