diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py
index c85271979..989b6d809 100644
--- a/files/helpers/sanitize.py
+++ b/files/helpers/sanitize.py
@@ -108,9 +108,7 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False):
emoji_partial = ''
emoji_html = None
- if path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
- emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs)
- elif emoji.endswith('pat'):
+ if emoji.endswith('pat'):
if path.isfile(f"files/assets/images/emojis/{emoji.replace('pat','')}.webp"):
attrs += ' pat'
emoji_html = f'{emoji_partial.format(old, f"/e/{emoji[:-3]}.webp", attrs)}'
@@ -118,6 +116,8 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False):
if u := get_user(emoji[1:-3], graceful=True):
attrs += ' pat'
emoji_html = f'{emoji_partial.format(old, f"/pp/{u.id}", attrs)}'
+ elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'):
+ emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs)
if emoji_html: