changeset 420:bec47da9052a

Prevent explosion on nil language
author nanaya <me@myconan.net>
date Thu, 17 Sep 2015 18:12:38 +0900
parents e34e0de34b65
children f0b4d6bec50e
files app/views/pastes/show.html.erb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/pastes/show.html.erb	Thu Sep 17 01:23:02 2015 +0900
+++ b/app/views/pastes/show.html.erb	Thu Sep 17 18:12:38 2015 +0900
@@ -26,7 +26,7 @@
     </div>
 
     <div role="tabpanel" class="tab-pane" id="hl">
-      <pre class="paste-show__content"><code class="js-paste-hl zp-hl lang-<%= @paste.language.parameterize %>"></code></pre>
+      <pre class="paste-show__content"><code class="js-paste-hl zp-hl lang-<%= @paste.language.try(:parameterize) %>"></code></pre>
     </div>
 
     <div role="tabpanel" class="tab-pane" id="md">