Fixing two potential NPEs found by findbugs

This commit is contained in:
kytv
2013-01-01 00:02:18 +00:00
parent adfc22499c
commit c05cd07ff7
2 changed files with 10 additions and 5 deletions

View File

@ -184,12 +184,14 @@ public class ProfileOrganizer {
*
*/
public PeerProfile addProfile(PeerProfile profile) {
if (profile == null) return null;
Hash peer = profile.getPeer();
if (profile == null || peer == null) return null;
if (peer == null) return null;
if (_log.shouldLog(Log.DEBUG))
_log.debug("New profile created for " + peer);
PeerProfile old = getProfile(peer);
profile.coalesceStats();
if (!getWriteLock())