From 1f9078638ebeb44ed48a3fb0ba1539db877721b5 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 16 Jun 2016 15:42:43 +0800 Subject: [PATCH] fix truncate bug when map desc is nil (#557) --- app/helpers/maps_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/maps_helper.rb b/app/helpers/maps_helper.rb index 169ee4b9..8a48ab33 100644 --- a/app/helpers/maps_helper.rb +++ b/app/helpers/maps_helper.rb @@ -8,7 +8,7 @@ module MapsHelper map['id'] = m.id map['label'] = m.name map['value'] = m.name - map['description'] = m.desc.truncate(30) + map['description'] = m.desc.try(:truncate, 30) map['permission'] = m.permission map['topicCount'] = m.topics.count map['synapseCount'] = m.synapses.count