Always return a Reply.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 05:56:50 +0000 (06:56 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 4 Nov 2010 05:56:50 +0000 (06:56 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 28ef2d7..adf580b 100644 (file)
@@ -310,7 +310,12 @@ public class Core implements IdentityListener {
         */
        public Reply getReply(String replyId) {
                synchronized (replies) {
-                       return replies.get(replyId);
+                       Reply reply = replies.get(replyId);
+                       if (reply == null) {
+                               reply = new Reply(replyId);
+                               replies.put(replyId, reply);
+                       }
+                       return reply;
                }
        }