1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Fix to avoid NPEs in data serialization for the case some settings are not initialized

This commit is contained in:
Mikhail Sennikovsky 2007-03-27 13:27:09 +00:00
parent 144c64ed44
commit 038a5598b4

View file

@ -1033,7 +1033,8 @@ public class ScannerConfigInfoFactory2 {
child = doc.createElement(BUILD_OUTPUT_PROVIDER);
grandchild = doc.createElement(OPEN_ACTION);
grandchild.setAttribute(ENABLED, Boolean.toString(po.buildOutputFileActionEnabled));
grandchild.setAttribute(FILE_PATH, po.buildOutputFilePath);
if(po.buildOutputFilePath != null)
grandchild.setAttribute(FILE_PATH, po.buildOutputFilePath);
child.appendChild(grandchild);
grandchild = doc.createElement(PARSER);
grandchild.setAttribute(ENABLED, Boolean.toString(po.buildOutputParserEnabled));
@ -1061,12 +1062,15 @@ public class ScannerConfigInfoFactory2 {
if (providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.RUN)) {
grandchild = doc.createElement(RUN_ACTION);
grandchild.setAttribute(USE_DEFAULT, Boolean.toString(ppo.providerRunUseDefault));
grandchild.setAttribute(COMMAND, ppo.providerRunCommand);
grandchild.setAttribute(ARGUMENTS, ppo.providerRunArguments);
if(ppo.providerRunCommand != null)
grandchild.setAttribute(COMMAND, ppo.providerRunCommand);
if(ppo.providerRunArguments != null)
grandchild.setAttribute(ARGUMENTS, ppo.providerRunArguments);
}
else if (providerKind.equals(ScannerConfigProfile.ScannerInfoProvider.OPEN)) {
grandchild = doc.createElement(OPEN_ACTION);
grandchild.setAttribute(FILE_PATH, ppo.providerOpenFilePath);
if(ppo.providerOpenFilePath != null)
grandchild.setAttribute(FILE_PATH, ppo.providerOpenFilePath);
}
child.appendChild(grandchild);
// parser