diff --git a/source/org/jivesoftware/smack/filter/ToContainsFilter.java b/source/org/jivesoftware/smack/filter/ToContainsFilter.java index 2932225b2..8ef32eacc 100644 --- a/source/org/jivesoftware/smack/filter/ToContainsFilter.java +++ b/source/org/jivesoftware/smack/filter/ToContainsFilter.java @@ -77,6 +77,11 @@ public class ToContainsFilter implements PacketFilter { } public boolean accept(Packet packet) { - return packet.getTo().indexOf(to) != -1; + if (packet.getTo() == null) { + return false; + } + else { + return packet.getTo().indexOf(to) != -1; + } } }