From 9f0e240f91fe5d648b313e4671c0ca13333352e7 Mon Sep 17 00:00:00 2001 From: Maximilian Grundke Date: Sat, 7 May 2016 16:16:30 +0200 Subject: [PATCH] Don't call (failing) policy selection if the exercise has no execution environment --- app/views/exercises/index.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exercises/index.html.slim b/app/views/exercises/index.html.slim index 47714943..97847f1f 100644 --- a/app/views/exercises/index.html.slim +++ b/app/views/exercises/index.html.slim @@ -28,7 +28,7 @@ h1 = Exercise.model_name.human(count: 2) tr data-id=exercise.id td = exercise.title td = link_to_if(policy(exercise.author).show?, exercise.author, exercise.author) - td = link_to_if(policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment) + td = link_to_if(exercise.execution_environment && policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment) td = exercise.files.teacher_defined_tests.count td = exercise.maximum_score td.public data-value=exercise.public? = symbol_for(exercise.public?)