diff --git a/builds/4chan-X.js b/builds/4chan-X.js index b69b6d829..47746c960 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -4827,9 +4827,9 @@ return new Notification('info', message, 2); }, hashScroll: function() { - var post; + var hash, post; - if (!(post = $.id(this.location.hash.slice(1)))) { + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { return; } if ((Get.postFromRoot(post)).isHidden) { diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 624cb9298..7982a66c8 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4818,9 +4818,9 @@ return new Notification('info', message, 2); }, hashScroll: function() { - var post; + var hash, post; - if (!(post = $.id(this.location.hash.slice(1)))) { + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { return; } if ((Get.postFromRoot(post)).isHidden) { diff --git a/builds/crx.crx b/builds/crx.crx index d89cda58f..86fd3b1b8 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 2f33179dc..49f3dde72 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4741,9 +4741,9 @@ return new Notification('info', message, 2); }, hashScroll: function() { - var post; + var hash, post; - if (!(post = $.id(this.location.hash.slice(1)))) { + if (!((hash = this.location.hash) && (post = $.id(hash.slice(1))))) { return; } if ((Get.postFromRoot(post)).isHidden) { diff --git a/src/features/misc/header.coffee b/src/features/misc/header.coffee index 64cba7c88..df668a4b7 100644 --- a/src/features/misc/header.coffee +++ b/src/features/misc/header.coffee @@ -194,7 +194,7 @@ Header = new Notification 'info', message, 2 hashScroll: -> - return unless post = $.id @location.hash[1..] + return unless (hash = @location.hash) and post = $.id hash[1..] return if (Get.postFromRoot post).isHidden Header.scrollToPost post