]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3646 do not fail on non-h2 databases when creating administrator
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 11 Jul 2012 22:07:47 +0000 (00:07 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 11 Jul 2012 22:07:47 +0000 (00:07 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/user.rb

index c70d33985a4cc50f3945d9f64b08ff4d6c928bd9..152900bede970d591ca6af903fcb21d9c6e47154 100644 (file)
@@ -207,6 +207,10 @@ class User < ActiveRecord::Base
   private
 
   def on_create
-    Java::OrgSonarServerUi::JRubyFacade.getInstance().onNewUser({'login' => self.login, 'name' => self.name, 'email' => self.email})
+    facade = Java::OrgSonarServerUi::JRubyFacade.getInstance()
+    if facade
+      # the facade is null when creating the administration in migration 011
+      facade.onNewUser({'login' => self.login, 'name' => self.name, 'email' => self.email})
+    end
   end
 end