changeset 478:46ed68bf9918

Add more length check
author nanaya <me@nanaya.pro>
date Sat, 10 Oct 2020 18:14:57 +0900
parents 7a20b4906267
children b493db1f40b0
files app/javascript/src/main.coffee
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/javascript/src/main.coffee	Sat Oct 10 18:13:56 2020 +0900
+++ b/app/javascript/src/main.coffee	Sat Oct 10 18:14:57 2020 +0900
@@ -74,9 +74,11 @@
 
 
 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()