From 6c3f07dc75039a45257d91440797a87a3d116a92 Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber <singpolyma@singpolyma.net>
Date: Mon, 6 Jan 2025 11:40:59 -0500
Subject: [PATCH] Fix NPE

(cherry picked from commit 5ae202766d99887b6a748dd0463124898a35bf3d)
---
 src/main/java/eu/siacs/conversations/entities/Conversation.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index f9cfb6c4f0..feb40e052c 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -1561,7 +1561,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
         final var script = locale.getScript();
         for (final var m : messages) {
             if (getMode() != MODE_MULTI) {
-                final var resource = m.getCounterpart().getResource();
+                final var resource = m.getCounterpart() == null ? null : m.getCounterpart().getResource();
                 if (resource != null && resource.length() < 10) {
                     anyMatchSpam = true;
                     return;