mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
bug 395259: NPE thrown in LanguageSettingsProviderTab when selecting a newly created configuration
This commit is contained in:
parent
98c42dd5e2
commit
22e5b8c486
1 changed files with 16 additions and 7 deletions
|
@ -185,9 +185,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
} else {
|
||||
ICConfigurationDescription cfgDescription = getConfigurationDescription();
|
||||
List<ILanguageSettingsProvider> initialProviders = initialProvidersByCfg.get(cfgDescription.getId());
|
||||
if (initialProviders != null) {
|
||||
initialProvider = findProvider(id, initialProviders);
|
||||
}
|
||||
initialProvider = findProvider(id, initialProviders);
|
||||
}
|
||||
return initialProvider;
|
||||
}
|
||||
|
@ -203,7 +201,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
if (!LanguageSettingsManager.isWorkspaceProvider(provider)) {
|
||||
ICConfigurationDescription cfgDescription = getConfigurationDescription();
|
||||
List<ILanguageSettingsProvider> initialProviders = initialProvidersByCfg.get(cfgDescription.getId());
|
||||
isWorkingCopy = ! initialProviders.contains(provider);
|
||||
isWorkingCopy = initialProviders != null && ! initialProviders.contains(provider);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -325,9 +323,11 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
* Find provider with a given ID in the list or {@code null}.
|
||||
*/
|
||||
private ILanguageSettingsProvider findProvider(String id, List<ILanguageSettingsProvider> providers) {
|
||||
for (ILanguageSettingsProvider provider : providers) {
|
||||
if (provider.getId().equals(id)) {
|
||||
return provider;
|
||||
if (providers != null) {
|
||||
for (ILanguageSettingsProvider provider : providers) {
|
||||
if (provider.getId().equals(id)) {
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -1073,6 +1073,15 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
if (!canBeVisible())
|
||||
return;
|
||||
|
||||
ICConfigurationDescription cfgDescription = getConfigurationDescription();
|
||||
String cfgId = cfgDescription.getId();
|
||||
if (!initialProvidersByCfg.containsKey(cfgId)) {
|
||||
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
|
||||
List<ILanguageSettingsProvider> initialProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
|
||||
initialProvidersByCfg.put(cfgId, initialProviders);
|
||||
}
|
||||
}
|
||||
|
||||
if (rcDes!=null) {
|
||||
if (page.isMultiCfg()) {
|
||||
setAllVisible(false, null);
|
||||
|
|
Loading…
Add table
Reference in a new issue