Add more length check
1 files changed, 3 insertions(+), 1 deletions(-)

M app/javascript/src/main.coffee
M app/javascript/src/main.coffee +3 -1
@@ 74,9 74,11 @@ showPreview = (e) ->
 
 
 switchToCurrentHash = ->
-  return unless $(".js-showing-paste").length
+  return if $(".js-showing-paste").length == 0
 
   format = window.location.hash.slice(1)
+
+  return if format.length == 0
   $(".js-show-tab[data-mode=#{format}]").click()