From 6328a49176de53708653299833bc4739dd9caacf Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 16 Sep 2011 17:44:54 +0200 Subject: [PATCH] Treat invalid own identity as no own identity. --- src/main/java/net/pterodactylus/wotns/main/Resolver.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.7.4