aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2011-08-17 12:51:54 +0200
committerDavid Cabo <david@calibea.com>2011-08-17 12:51:54 +0200
commit6c692dea355ea2a057a01e795466a19f81b494aa (patch)
tree2f67afa7709c0bc969c6772d197c7354736ada60 /app/models
parent817ce18d16d037aadc5ea44d93854c6e17f06747 (diff)
parente97c2d1b664dec8e04dd372f176feb0a0efd8cf9 (diff)
Merge branch 'fixes' into asktheeu
Diffstat (limited to 'app/models')
-rw-r--r--app/models/public_body.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index e90050688..b4d1b6704 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -53,7 +53,7 @@ class PublicBody < ActiveRecord::Base
# XXX - Don't like repeating this!
def calculate_cached_fields(t)
- t.first_letter = t.name.scan(/^./mu)[0].upcase
+ t.first_letter = t.name.scan(/^./mu)[0].upcase unless t.name.nil? or t.name.empty?
short_long_name = t.name
short_long_name = t.short_name if t.short_name and !t.short_name.empty?
t.url_name = MySociety::Format.simplify_url_part(short_long_name, 'body')