Skip to content

Commit

Permalink
Make sure list is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Dengler committed Feb 27, 2023
1 parent dd586a3 commit 2c13fc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CybORG/Agents/Wrappers/RedTableWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ def _process_exploit(self, obs):

def _process_priv_esc(self, obs, hostname):
if obs['success'] == False:
[info for info in self.red_info.values() if info[2] == hostname][0][4] = 'None'
red_info = [info for info in self.red_info.values() if info[2] == hostname]
if len(red_info) > 0:
red_info[0][4] = 'None'
else:
for hostid in obs:
if hostid == 'success':
Expand Down

0 comments on commit 2c13fc5

Please sign in to comment.