From 81dbe5447bde8b8e5d4afc78b1afdd5e5dacc38a Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:02:07 +0100 Subject: [PATCH] fix: js error when no user --- js/src/forum/extenders/extendCommentPost.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/extenders/extendCommentPost.tsx b/js/src/forum/extenders/extendCommentPost.tsx index c7cc9cc..13a3b63 100644 --- a/js/src/forum/extenders/extendCommentPost.tsx +++ b/js/src/forum/extenders/extendCommentPost.tsx @@ -10,7 +10,7 @@ export default function extendCommentPost() { if (app.forum.attribute('fof-geoip.showFlag')) { const ipInfo = this.attrs.post.ip_info?.(); const postUser = this.attrs.post.user(); - if (postUser && postUser.preferences().showIPCountry && ipInfo) { + if (postUser && postUser?.preferences?.().showIPCountry && ipInfo) { const { image } = getIPData(ipInfo); if (image) { items.add('country', image, 100);