summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-10-12 16:19:43 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-10-12 16:19:43 +0200
commit4ea812d55a4ed6426b8187e774a0935e20ea34a2 (patch)
treea25f3031d9abdf8b25d9db42e677de7daaf8bd88
parent6fcefb3827afd8c7a92d9fac2251f44cd270ce09 (diff)
downloadgitlab-ce-4ea812d55a4ed6426b8187e774a0935e20ea34a2.tar.gz
Fix 500 when last_deployment is missing
-rw-r--r--app/views/projects/environments/_environment.html.haml9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml
index a995a49023d..09fa4375310 100644
--- a/app/views/projects/environments/_environment.html.haml
+++ b/app/views/projects/environments/_environment.html.haml
@@ -28,7 +28,8 @@
#{time_ago_with_tooltip(last_deployment.created_at)}
%td.hidden-xs
- = render 'projects/deployments/actions', deployment: last_deployment,
- allow_close: environment.opened?, allow_rollback: environment.closed?,
- show_external_url: environment.opened?, show_actions: environment.opened?,
- show_terminal: environment.opened?
+ - if last_deployment
+ = render 'projects/deployments/actions', deployment: last_deployment,
+ allow_close: environment.opened?, allow_rollback: environment.closed?,
+ show_external_url: environment.opened?, show_actions: environment.opened?,
+ show_terminal: environment.opened?