From 165fda9dadfd28f466192fb393b99b4074386be1 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Fri, 15 Dec 2006 23:15:21 +0000 Subject: [PATCH] don't through a nullpointer exc when storing a null password but rather remove the existing password. --- .../service/protocol/ProtocolProviderFactory.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java index deb221ffa..dc343b53f 100644 --- a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java +++ b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java @@ -266,8 +266,13 @@ protected void storePassword(BundleContext bundleContext, + " in package" + getFactoryImplPackageName()); //obscure the password - String mangledPassword - = new String(Base64.encode(password.getBytes())); + String mangledPassword = null; + + //if password is null then the caller simply wants the current password + //removed from the cache. make sure they don't get a null pointer + //instead. + if(password != null) + mangledPassword = new String(Base64.encode(password.getBytes())); //get a reference to the config service and store it. ServiceReference confReference