From 74df2559a44121f50cb211120c129b883802a1f1 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 13 May 2017 10:49:46 -0700 Subject: [PATCH] try to fix fatal on notifications index when a topic is invalid (#1115) * try to fix fatal on notifications index when a topic is invalid * Update index.html.erb --- app/views/notifications/index.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index e965f481..ec9987f6 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -37,13 +37,13 @@ map = notification.notified_object.map %> added topic <%= topic.name %> to map <%= map.name %> <% when TOPIC_CONNECTED_1 %> - <% topic1 = notification.notified_object.topic1 - topic2 = notification.notified_object.topic2 %> - connected <%= topic1.name %> to <%= topic2.name %> + <% topic1 = notification.notified_object&.topic1 %> + <% topic2 = notification.notified_object&.topic2 %> + connected <%= topic1&.name %> to <%= topic2&.name %> <% when TOPIC_CONNECTED_2 %> - <% topic1 = notification.notified_object.topic1 - topic2 = notification.notified_object.topic2 %> - connected <%= topic2.name %> to <%= topic1.name %> + <% topic1 = notification.notified_object&.topic1 %> + <% topic2 = notification.notified_object&.topic2 %> + connected <%= topic2&.name %> to <%= topic1&.name %> <% when MESSAGE_FROM_DEVS %> <%= notification.subject %> <% end %>