]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Add an extra null pointer check that can trigger in tests
[rails.git] / app / models / user.rb
index 1a476954440f8b308be08c63c0ed8072dd7c5e03..09e1a7d35611a9c3178a4832a3b19845b5faf0fe 100644 (file)
@@ -86,7 +86,7 @@ class User < ActiveRecord::Base
   end
 
   def languages
-    attribute_present?(:languages) ? read_attribute(:languages).split(",") : []
+    attribute_present?(:languages) ? read_attribute(:languages).split(/ *, */) : []
   end
 
   def languages=(languages)