mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
NPE elimination
This commit is contained in:
parent
bac604f82e
commit
68059d3675
1 changed files with 9 additions and 4 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue