From a3a474a5a2450cc065a7630b25e4d4ca2ff5f8d7 Mon Sep 17 00:00:00 2001 From: Shane Cavanaugh Date: Fri, 21 Apr 2017 15:32:36 -0400 Subject: [PATCH] Guard clause against labels being nil --- lib/tracker_api/resources/story.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tracker_api/resources/story.rb b/lib/tracker_api/resources/story.rb index bc95924..acbaa87 100644 --- a/lib/tracker_api/resources/story.rb +++ b/lib/tracker_api/resources/story.rb @@ -61,7 +61,10 @@ class UpdateRepresenter < Representable::Decorator # @return [String] Comma separated list of labels. def label_list - @label_list ||= labels.collect(&:name).join(',') + @label_list ||= begin + return if labels.nil? + labels.collect(&:name).join(',') + end end # Adds a new label to the story.