Fix a null pointer exception that arise when I tried to create a group on AIM when disconnected from the network.

cusax-fix
Benoit Pradelle 18 years ago
parent 381c69de74
commit 543d0bfdb5

@ -507,9 +507,6 @@ private ContactGroup resolveProtoPath(ProtocolProviderService protoProvider,
throw new NullPointerException("Internal Error. Orphan group.");
}
ContactGroup parentProtoGroup
= resolveProtoPath(protoProvider, parentMetaGroup);
OperationSetPersistentPresence opSetPersPresence
= (OperationSetPersistentPresence) protoProvider
.getSupportedOperationSets().get(OperationSetPersistentPresence
@ -522,6 +519,15 @@ private ContactGroup resolveProtoPath(ProtocolProviderService protoProvider,
return null;
}
ContactGroup parentProtoGroup;
// special treatment for the root group (stop the recursion)
if (parentMetaGroup.getParentMetaContactGroup() == null) {
parentProtoGroup = opSetPersPresence.
getServerStoredContactListRoot();
} else {
parentProtoGroup = resolveProtoPath(protoProvider, parentMetaGroup);
}
//create the proto group
BlockingGroupEventRetriever evtRetriever
= new BlockingGroupEventRetriever(metaGroup.getGroupName());
@ -722,7 +728,7 @@ public void createMetaContactGroup(MetaContactGroup parent,
MetaContactGroupImpl newMetaGroup = new MetaContactGroupImpl(groupName);
( (MetaContactGroupImpl) parent).addSubgroup(newMetaGroup);
//fire the event
fireMetaContactGroupEvent(newMetaGroup
, null, null, MetaContactGroupEvent. META_CONTACT_GROUP_ADDED);

Loading…
Cancel
Save