From 1c42e5da30f0d5f95f91b436fc26e6095650f4f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 9 Oct 2012 20:03:56 +0200 Subject: [PATCH] Use default values if values can not be parsed. Thanks to digger3 for spotting this one. --- .../java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java b/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java index 53a45b1..c4e8d89 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java @@ -144,8 +144,8 @@ public class WebOfTrustConnector { identity.setContexts(parseContexts("Contexts" + identityCounter + ".", fields)); identity.setProperties(parseProperties("Properties" + identityCounter + ".", fields)); Integer trust = Numbers.safeParseInteger(fields.get("Trust" + identityCounter), null); - int score = Numbers.safeParseInteger(fields.get("Score" + identityCounter)); - int rank = Numbers.safeParseInteger(fields.get("Rank" + identityCounter)); + int score = Numbers.safeParseInteger(fields.get("Score" + identityCounter), 0); + int rank = Numbers.safeParseInteger(fields.get("Rank" + identityCounter), 0); identity.setTrust(ownIdentity, new Trust(trust, score, rank)); identities.add(identity); } -- 2.7.4