From cd0e444d1629949617ce9b3a277ca7f20e624d8f Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 16 Aug 2020 20:33:19 +0200 Subject: [PATCH] i broke single-image nsfw posts again :( --- script/single.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/single.js b/script/single.js index 3d30537..dc8fae7 100644 --- a/script/single.js +++ b/script/single.js @@ -82,7 +82,9 @@ function setup() { mainfig = document.getElementById('mainfig'); mainimg = document.getElementById('mainimg'); mainlink = document.getElementById('mainlink'); - altButtons = document.getElementById('alts').getElementsByTagName('input'); + + let alts = document.getElementById('alts'); + altButtons = alts ? Array.from(alts.getElementsByTagName('input')) : []; for (let button of altButtons) { button.onchange = e => { if (button.checked) activateButton(button); };