From 39562aad7e2d5516a9e89e260c1b437923d484b1 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 2 Jul 2016 09:44:32 +0800 Subject: [PATCH] if mappable is nil it causes an error --- app/policies/mapping_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/policies/mapping_policy.rb b/app/policies/mapping_policy.rb index 5826ccd4..ce8522df 100644 --- a/app/policies/mapping_policy.rb +++ b/app/policies/mapping_policy.rb @@ -16,7 +16,7 @@ class MappingPolicy < ApplicationPolicy end def show? - map_policy.show? && mappable_policy.show? + map_policy.show? && mappable_policy.try(:show?) end def create?