Commit d6840a7bdfde7c61628ad2b5e1712fbfd2d13e8f
1 parent
5daba9af
Exists in
master
and in
29 other branches
stoa-webservice: avoid crash if person has no birth_date
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
plugins/stoa/lib/stoa_plugin/person_api.rb
@@ -20,7 +20,7 @@ class StoaPlugin::PersonApi < Noosfero::FieldsDecorator | @@ -20,7 +20,7 @@ class StoaPlugin::PersonApi < Noosfero::FieldsDecorator | ||
20 | end | 20 | end |
21 | 21 | ||
22 | def birth_date | 22 | def birth_date |
23 | - object.birth_date.strftime('%F') | 23 | + object.birth_date.present? ? object.birth_date.strftime('%F') : nil |
24 | end | 24 | end |
25 | 25 | ||
26 | def image_base64 | 26 | def image_base64 |