Skip to content

Commit 3d3e0e0

Browse files
committed
Internal: Fix script error running OBJ09-J #4995
1 parent 7189f2a commit 3d3e0e0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • CodeCheck/Published Standards/SEI Cert Standards/Java/OBJ09-J

CodeCheck/Published Standards/SEI Cert Standards/Java/OBJ09-J/check.upy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def check(check: CheckContext, file: Ent):
106106
if dParam[0] > -1:
107107
if "Unknown" not in dParam[1].kindname():#need to check that it isnt a built in
108108
params = get_params(dParam[1].ref())
109-
p = params[dParam[0]] if params else ("", None)
110-
if "final" in p[0] or pot:
109+
p = params[dParam[0]] if 0 <= dParam[0] < len(params) else ("", None)
110+
if p[1] is not None and ("final" in p[0] or pot):
111111
compare = False
112112
for useofpar in p[1].ent().refs("Useby ~Use"):
113113
if var_is_compared(useofpar):
@@ -130,10 +130,10 @@ def check(check: CheckContext, file: Ent):
130130
#check if we are used as a param
131131
param = passed_as_param(useof)
132132
if param[0] > -1:
133-
if "Unknown" not in dParam[1].kindname():#need to check that it isnt a built in
133+
if param[1] is not None and "Unknown" not in param[1].kindname():#need to check that it isnt a built in
134134
params = get_params(param[1].ref())
135-
p = params[param[0]]
136-
if "final" in p[0] or pot:
135+
p = params[param[0]] if 0 <= param[0] < len(params) else ("", None)
136+
if p[1] is not None and ("final" in p[0] or pot):
137137
compare = False
138138
for useofpar in p[1].ent().refs("Useby ~Use"):
139139
if var_is_compared(useofpar):

0 commit comments

Comments
 (0)