Commit d6840a7bdfde7c61628ad2b5e1712fbfd2d13e8f

Authored by Rodrigo Souto
1 parent 5daba9af

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 20 end
21 21  
22 22 def birth_date
23   - object.birth_date.strftime('%F')
  23 + object.birth_date.present? ? object.birth_date.strftime('%F') : nil
24 24 end
25 25  
26 26 def image_base64
... ...