mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Protect against an NPE.
This commit is contained in:
parent
4cf72bb41b
commit
4890e6e7e6
2 changed files with 8 additions and 2 deletions
|
@ -80,6 +80,10 @@ public class CPPFunctionSet implements ICPPTwoPhaseBinding {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template arguments, or {@code null} if the function set doesn't represent a template
|
||||
* specialization.
|
||||
*/
|
||||
public ICPPTemplateArgument[] getTemplateArguments() {
|
||||
return fTemplateArguments;
|
||||
}
|
||||
|
|
|
@ -332,8 +332,10 @@ public class EvalFunctionSet extends CPPDependentEvaluation {
|
|||
int r = CPPTemplates.PACK_SIZE_NOT_FOUND;
|
||||
if (fFunctionSet != null) {
|
||||
ICPPTemplateArgument[] templateArguments = fFunctionSet.getTemplateArguments();
|
||||
for (ICPPTemplateArgument arg : templateArguments) {
|
||||
r = CPPTemplates.combinePackSize(r, CPPTemplates.determinePackSize(arg, tpMap));
|
||||
if (templateArguments != null) {
|
||||
for (ICPPTemplateArgument arg : templateArguments) {
|
||||
r = CPPTemplates.combinePackSize(r, CPPTemplates.determinePackSize(arg, tpMap));
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
|
|
Loading…
Add table
Reference in a new issue