Skip to content

Commit b4ef863

Browse files
committed
Code-color: Fix JS error
Only seen when used with a certain chrome extension
1 parent 7707aa1 commit b4ef863

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github-code-colors.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name GitHub Code Colors
3-
// @version 1.2.0
3+
// @version 1.2.1
44
// @description A userscript that adds a color swatch next to the code color definition
55
// @license MIT
66
// @author Rob Garrison
@@ -134,7 +134,7 @@
134134
while (els.length) {
135135
let el = els.shift();
136136
let txt = el.textContent;
137-
if (el.parentNode.classList.contains("pl-c1")) {
137+
if (el.parentNode && el.parentNode.classList.contains("pl-c1")) {
138138
// Ignore nested pl-c1 (see https://git.io/vFx8y)
139139
} else if (!el.querySelector(".ghcc-block")) {
140140
if (el.classList.contains("pl-s")) {

0 commit comments

Comments
 (0)