1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

NPE elimination

This commit is contained in:
Oleg Krasilnikov 2008-04-10 14:09:43 +00:00
parent bac604f82e
commit 68059d3675

View file

@ -198,15 +198,20 @@ public class ToolSettingsPrefStore implements IPreferenceStore {
}
public Object[] getOption(String id){
if (selectedElement == null) return null;
if (selectedElement == null)
return null;
IHoldsOptions selectedHolder = selectedElement.getHoldOptions();
if (selectedHolder == null) selectedHolder = selectedElement.getTool();
if (selectedHolder == null)
selectedHolder = selectedElement.getTool();
Object options[][] = optCategory.getOptions(rcInfo, selectedHolder);
if (options == null)
return null;
for(int i = 0; i < options.length; i++){
IHoldsOptions ho = (IHoldsOptions)options[i][0];
if(ho == null) break;
if(ho == null)
break;
IOption option = (IOption)options[i][1];