From f1135854a0633e36a72356f61c74c728895da1b3 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 11 Nov 2014 07:23:44 -0500 Subject: [PATCH] fix for when mappings are corrupt --- app/controllers/maps_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 5a07d405..58f778d9 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -89,7 +89,7 @@ class MapsController < ApplicationController elsif m.category == "Topic" object = m.topic end - object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id)) + !object || (object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id))) } respond_with(@allmappers, @allmappings, @allsynapses, @alltopics, @map) @@ -117,7 +117,7 @@ class MapsController < ApplicationController elsif m.category == "Topic" object = m.topic end - object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id)) + !object || (object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id))) } @json = Hash.new()