Fix parsing of latest edition when it’s not present.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 19 Sep 2014 20:35:37 +0000 (22:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 19 Sep 2014 20:35:37 +0000 (22:35 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 5fa330b..5867415 100644 (file)
@@ -768,8 +768,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        logger.log(Level.WARNING, "Given Identity is null!");
                        return null;
                }
-               final Long latestEdition = fromNullable(tryParse(
-                               identity.getProperty("Sone.LatestEdition"))).or(0L);
+               final Long latestEdition = tryParse(fromNullable(
+                               identity.getProperty("Sone.LatestEdition")).or("0"));
                synchronized (sones) {
                        final Sone sone = getRemoteSone(identity.getId(), true);
                        if (sone.isLocal()) {