1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-16 20:55:44 +02:00

[dstore] null pointer check in property change listener (caught this while debugging)

This commit is contained in:
David McKnight 2008-01-22 17:17:13 +00:00
parent e5d73be2dc
commit a197fa8c45

View file

@ -164,10 +164,11 @@ public class RemoteFilePropertyChangeListener implements IDomainListener,
if (dataStore == parent.getDataStore())
{
String dataElementType = parent.getType();
if (dataElementType
if (dataElementType != null &&
(dataElementType
.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR) ||
dataElementType
.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)
.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR))
)
{
return true;
@ -209,9 +210,9 @@ public class RemoteFilePropertyChangeListener implements IDomainListener,
DataElement subject = (DataElement) children.get(i);
String type = subject.getType();
if (type
.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) ||
type.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR))
if (type != null &&
(type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) ||
type.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR)))
{
StringBuffer path = new StringBuffer(subject.getAttribute(DE.A_VALUE));