fix null modes error
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Ben Harris 2020-10-23 17:38:27 -04:00
parent 5ca47ce551
commit 700a5955e7
1 changed files with 4 additions and 3 deletions

View File

@ -38,10 +38,12 @@ out["channels"] = []
for c in root.findall("./channellist/channel"):
name = unsanitize(c.find("channelname"))
modes = c.find("./channelmodes").text
if (
# skip channels in the blacklist or with mode +s
"s" in c.find("./channelmodes").text.split()[0]
or name in BLACKLIST
name in BLACKLIST
or modes is None
or "s" in modes.split()[0]
):
continue
@ -54,7 +56,6 @@ for c in root.findall("./channellist/channel"):
)
)
out["channels"].sort(key=lambda x: x["name"].lower())
with open(f"{WORK_DIR}/stats.json", "w") as f: