diff app/views/pastes/show.html.erb @ 420:bec47da9052a

Prevent explosion on nil language
author nanaya <me@myconan.net>
date Thu, 17 Sep 2015 18:12:38 +0900
parents a69dd2d37950
children 967233b26404
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">