From: David ‘Bombe’ Roden Date: Mon, 20 Jul 2015 16:40:27 +0000 (+0200) Subject: Make parsing of Sone.LatestEdition more robust X-Git-Tag: 0.9.3^2~15^2~7 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7a858fcaa81f9cfab771e42865c0c2da6a438c40;p=Sone.git Make parsing of Sone.LatestEdition more robust --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index da9bd83..fe0907f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -687,8 +687,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, logger.log(Level.WARNING, "Given Identity is null!"); return null; } - final Long latestEdition = tryParse(fromNullable( - identity.getProperty("Sone.LatestEdition")).or("0")); + String property = fromNullable(identity.getProperty("Sone.LatestEdition")).or("0"); + long latestEdition = fromNullable(tryParse(property)).or(0L); Optional existingSone = getSone(identity.getId()); if (existingSone.isPresent() && existingSone.get().isLocal()) { return existingSone.get();