From 5c16fdb0174b0db302f54f40bc35cc9df4f4e181 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 3 Feb 2015 18:58:45 +0100 Subject: [PATCH] Make Presence.getMode() return available if null --- .../main/java/org/jivesoftware/smack/packet/Presence.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java index 5af896579..a9406c804 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java @@ -180,13 +180,14 @@ public final class Presence extends Packet { } /** - * Returns the mode of the presence update, or null if the mode is not set. - * A null presence mode value is interpreted to be the same thing as - * {@link Presence.Mode#available}. + * Returns the mode of the presence update. * * @return the mode. */ public Mode getMode() { + if (mode == null) { + return Mode.available; + } return mode; }