1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 580009 - Avoid rare NPE due to folder info not being loaded

Guard against NPE. Full cause needs to be investigated but with this
check the behaviour is no worse than before in these cases

Change-Id: I27ed2cd915e21fca2ef07335820d9e2496c1c51d
This commit is contained in:
William Riley 2022-05-31 15:34:09 +01:00
parent 450dbf0d57
commit c678c76a40

View file

@ -527,7 +527,8 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
if (parent instanceof IToolChain) {
IConfiguration config = ((IToolChain) parent).getParent();
IOption foundOption = null;
if (config != null) {
//In rare cases the RootFolderInfo may not have loaded & will cause an NPE
if (config != null && config.getRootFolderInfo() != null) {
IToolChain parentToolchain = config.getToolChain();
if (parentToolchain != null) {
foundOption = parentToolchain.getOptionById(superClassId);