Skip to content

Commit

Permalink
add resiliance to has_event? checkt
Browse files Browse the repository at this point in the history
  • Loading branch information
angusmcleod committed Jul 11, 2019
1 parent 2219ea3 commit 1a715b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin.rb
Expand Up @@ -152,7 +152,9 @@ class SiteSettings::TypeSupervisor
require_dependency 'topic'
class ::Topic
def has_event?
self.custom_fields['event_start']&.nonzero?
self.custom_fields['event_start'].present? &&
self.custom_fields['event_start'].is_a?(Numeric) &&
self.custom_fields['event_start'] != 0
end

def event
Expand Down

0 comments on commit 1a715b6

Please sign in to comment.