Explicitely store a null if there is no recipient.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 16:35:21 +0000 (17:35 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 16:35:21 +0000 (17:35 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 24f1209..52ebfab 100644 (file)
@@ -1143,9 +1143,7 @@ public class Core implements IdentityListener {
                        for (Post post : sone.getPosts()) {
                                String postPrefix = sonePrefix + "/Posts/" + postCounter++;
                                configuration.getStringValue(postPrefix + "/ID").setValue(post.getId());
-                               if (post.getRecipient() != null) {
-                                       configuration.getStringValue(postPrefix + "/Recipient").setValue(post.getRecipient().getId());
-                               }
+                               configuration.getStringValue(postPrefix + "/Recipient").setValue((post.getRecipient() != null) ? post.getRecipient().getId() : null);
                                configuration.getLongValue(postPrefix + "/Time").setValue(post.getTime());
                                configuration.getStringValue(postPrefix + "/Text").setValue(post.getText());
                        }