From: David ‘Bombe’ Roden Date: Fri, 16 Sep 2011 15:44:54 +0000 (+0200) Subject: Treat invalid own identity as no own identity. X-Git-Tag: 0.0.6^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6328a49176de53708653299833bc4739dd9caacf;p=WoTNS.git Treat invalid own identity as no own identity. --- diff --git a/src/main/java/net/pterodactylus/wotns/main/Resolver.java b/src/main/java/net/pterodactylus/wotns/main/Resolver.java index 0150f45..0d94ce2 100644 --- a/src/main/java/net/pterodactylus/wotns/main/Resolver.java +++ b/src/main/java/net/pterodactylus/wotns/main/Resolver.java @@ -87,7 +87,9 @@ public class Resolver { } @SuppressWarnings("hiding") final OwnIdentity ownIdentity; - if (this.ownIdentityId == null) { + if ((this.ownIdentityId != null) && (identityManager.getOwnIdentity(this.ownIdentityId) != null)) { + ownIdentity = identityManager.getOwnIdentity(this.ownIdentityId); + } else if (this.ownIdentityId == null) { Set ownIdentities = identityManager.getAllOwnIdentities(); if (!ownIdentities.isEmpty()) { ownIdentity = ownIdentities.iterator().next(); @@ -95,7 +97,7 @@ public class Resolver { ownIdentity = null; } } else { - ownIdentity = identityManager.getOwnIdentity(ownIdentityId); + ownIdentity = null; } if (ownIdentity == null) { return null;