From 7a858fcaa81f9cfab771e42865c0c2da6a438c40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 20 Jul 2015 18:40:27 +0200 Subject: [PATCH] Make parsing of Sone.LatestEdition more robust --- src/main/java/net/pterodactylus/sone/core/Core.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.7.4