Log error if no parent-element is found.

This commit is contained in:
tastytea 2019-05-29 11:59:33 +02:00
parent 73c38258f1
commit b36a037016
Signed by untrusted user: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 1 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.2
// @version 2019.05.29.3
// @author tastytea
// @copyright 2019, tastytea (https://tastytea.de/)
// @license GPL-3.0-only
@ -49,6 +49,7 @@ function add_button()
root = document.getElementsByClassName("footer")[0];
if (root === undefined)
{
console.log(`Error: no suitable parent-element found.`);
return;
}
}