Fixed root-element check.

This commit is contained in:
tastytea 2019-05-29 03:42:00 +02:00
parent 75a25a9e44
commit 73c38258f1
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Mastodon CW toggle
// @description Toggles the visibility of all statuses with content warnings on status-pages.
// @version 2019.05.29.1
// @version 2019.05.29.2
// @author tastytea
// @copyright 2019, tastytea (https://tastytea.de/)
// @license GPL-3.0-only
@ -44,10 +44,10 @@ function add_button()
{
// If there is no element named “column-1”, use the footer.
var root = document.getElementsByClassName("column-1")[0];
if (root === null)
if (root === undefined)
{
root = document.getElementsByClassName("footer")[0];
if (root === null)
if (root === undefined)
{
return;
}