[sip-comm-dev] [PATCH] Fix two potential NullPointException-s


#1

Hi all,

I find there're some problems with
"sip/communicator/impl/protocol/icq/ProtocolProviderFactoryIcqImpl.java" and
"sip/communicator/impl/protocol/gibberish/ProtocolProviderFactoryGibberishImpl.java"
which may cause NullPointException-s:

The original code:
<code>
*accountProperties.put(USER_ID, accountID.getUserID());

if (accountProperties == null)
            throw new NullPointerException(
                "The specified property map was null");*
</code>

After fixing:
<code>
*if (accountProperties == null)
            throw new NullPointerException(
                "The specified property map was null");

accountProperties.put(USER_ID, accountID.getUserID());*
</code>

The attached file is the patch.

Cheers,
Dai

fix_nullexception_for_trunk_rev4319.patch (1.74 KB)


#2

Dai,

Thanks for the patch! It's committed in 4325 (with the minor
modification to move the checks of the two arguments at the very
beginning of the methods) and acknowledged on
http://www.sip-communicator.org/index.php/Development/TeamAndContributors.

Regards,
Lubo

···

On Fri, Aug 22, 2008 at 5:57 AM, DaiZW <shinysky1986@gmail.com> wrote:

Hi all,

I find there're some problems with
"sip/communicator/impl/protocol/icq/ProtocolProviderFactoryIcqImpl.java" and
"sip/communicator/impl/protocol/gibberish/ProtocolProviderFactoryGibberishImpl.java"
which may cause NullPointException-s:

The original code:
<code>
accountProperties.put(USER_ID, accountID.getUserID());

if (accountProperties == null)
            throw new NullPointerException(
                "The specified property map was null");
</code>

After fixing:
<code>
if (accountProperties == null)
            throw new NullPointerException(
                "The specified property map was null");

accountProperties.put(USER_ID, accountID.getUserID());
</code>

The attached file is the patch.

Cheers,
Dai

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net