Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

markdown: Add missing None check in InlineInterestingLinkProcessor.

Anders Kaseorgd01c99d2eeeb
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py
index 126787268b1..dd8124da889 100644
--- a/zerver/lib/markdown/__init__.py
+++ b/zerver/lib/markdown/__init__.py
@@ -1242,7 +1242,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
parsed_url = urllib.parse.urlsplit(urllib.parse.urljoin("/", url))
host = parsed_url.netloc
- if host != "" and host != self.md.zulip_realm.host:
+ if host != "" and (self.md.zulip_realm is None or host != self.md.zulip_realm.host):
continue
if not parsed_url.path.startswith("/user_uploads/"):