Commit a8fd358
committed
Handle nonexistant analyzers
Trying to submit to an analyzer that is not configured results in an
AttributeError because property id of the analyzer object is accessed
regardless of the result of get_by_name:
File "/cortex4py/cortex4py/controllers/analyzers.py", line 90, in run_by_name
return self.run_by_id(analyzer.id, observable, **kwargs)
AttributeError: 'NoneType' object has no attribute 'id'
Add a check for the result of get_by_name() and throw a CortexError with
explanatory message on failure.
Signed-off-by: Michael Weiser <michael.weiser@gmx.de>1 parent ee48cba commit a8fd358
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
0 commit comments