mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 20:15:22 +02:00
[fix] Bug 283844: NPE on restoring property set if persistent data is corrupted
This commit is contained in:
parent
5461401e09
commit
c0f678f895
1 changed files with 8 additions and 2 deletions
|
@ -26,6 +26,7 @@
|
||||||
* David McKnight (IBM) - [245198] [dstore] ServerLauncherProperties not restored
|
* David McKnight (IBM) - [245198] [dstore] ServerLauncherProperties not restored
|
||||||
* David McKnight (IBM) - [267052] need to be able to create subsystems-after-the-fact
|
* David McKnight (IBM) - [267052] need to be able to create subsystems-after-the-fact
|
||||||
* David McKnight (IBM) - [271243] [files] Switching service type brings up TWO file subsystems after restart
|
* David McKnight (IBM) - [271243] [files] Switching service type brings up TWO file subsystems after restart
|
||||||
|
* Uwe Stieber (Wind River) - [283844] NPE on restoring property set if persistent data is corrupted
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.persistence.dom;
|
package org.eclipse.rse.internal.persistence.dom;
|
||||||
|
@ -559,8 +560,13 @@ public class RSEDOMImporter {
|
||||||
set.setDescription(attribute.getValue());
|
set.setDescription(attribute.getValue());
|
||||||
} else {
|
} else {
|
||||||
String typeStr = attribute.getType();
|
String typeStr = attribute.getType();
|
||||||
IPropertyType type = PropertyType.fromString(typeStr);
|
// We keep getting reports throwing NPE in PropertyType.fromString(...).
|
||||||
set.addProperty(attribute.getKey(), attribute.getValue(), type);
|
// If the data is corrupted and the type cannot be determined, it is better
|
||||||
|
// to just drop the single property than the whole property set
|
||||||
|
if (typeStr != null) {
|
||||||
|
IPropertyType type = PropertyType.fromString(typeStr);
|
||||||
|
set.addProperty(attribute.getKey(), attribute.getValue(), type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// properties are now stored as children, get those next
|
// properties are now stored as children, get those next
|
||||||
|
|
Loading…
Add table
Reference in a new issue