Skip to content

Commit 6315e20

Browse files
committed
Check for existence of domain (refs #38)
1 parent fd3e6de commit 6315e20

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

core/html.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,11 @@ def render_post(self, html: str, post) -> str:
340340
parser = FediverseHtmlParser(
341341
html,
342342
mentions=post.mentions.all(),
343-
uri_domain=(None if self.local else post.author.domain.uri_domain),
343+
uri_domain=(
344+
None
345+
if self.local or not post.author.domain
346+
else post.author.domain.uri_domain
347+
),
344348
find_hashtags=True,
345349
find_emojis=self.local,
346350
emoji_domain=post.author.domain,
@@ -355,7 +359,11 @@ def render_identity_summary(self, html: str, identity) -> str:
355359
return ""
356360
parser = FediverseHtmlParser(
357361
html,
358-
uri_domain=(None if self.local else identity.domain.uri_domain),
362+
uri_domain=(
363+
None
364+
if self.local or not identity.domain
365+
else identity.domain.uri_domain
366+
),
359367
find_hashtags=True,
360368
find_emojis=self.local,
361369
emoji_domain=identity.domain,

0 commit comments

Comments
 (0)