From: David ‘Bombe’ Roden Date: Tue, 9 Oct 2012 18:03:56 +0000 (+0200) Subject: Use default values if values can not be parsed. X-Git-Tag: 0.8.4^2~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1c42e5da30f0d5f95f91b436fc26e6095650f4f1;p=Sone.git Use default values if values can not be parsed. Thanks to digger3 for spotting this one. --- 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); }