Skip to content

Commit

Permalink
Safety checking lenth of lib before indexing.
Browse files Browse the repository at this point in the history
  • Loading branch information
JezSw committed Feb 14, 2024
1 parent 40e8154 commit 6c376a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jade/computational.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def executeBenchmarksRoutines(session, lib: str, runoption, exp=False) -> None:

# Handle dic string as lib
pat_libs = re.compile(r'"\d\d[a-zA-Z]"')
if lib[0] == "{":
if len(lib)>0 and lib[0] == "{":
libs = pat_libs.findall(lib)
libpath = libs[1][1:-1]
elif "-" in lib:
Expand Down
2 changes: 1 addition & 1 deletion jade/libmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def select_lib(self, code: str = "mcnp") -> str:
if lib in self.libraries[code]:
break

elif lib[0] == "{":
elif len(lib)>0 and lib[0] == "{":
libs = json.loads(lib)
# all libraries should be available
tocheck = list(libs.values())
Expand Down

0 comments on commit 6c376a6

Please sign in to comment.