Skip to content

Commit

Permalink
FEM: Initialise result_object to None to fix crash on empty results
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Oct 25, 2015
1 parent 80b82dd commit bba3543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Mod/Fem/FemTools.py
Expand Up @@ -64,6 +64,7 @@ def __init__(self, analysis=None, test_mode=False):
else:
self.ccx_binary_present = False
self.setup_ccx()
self.result_object = None
else:
raise Exception('FEM: No active analysis found!')

Expand Down Expand Up @@ -416,7 +417,7 @@ def load_results(self):
for m in self.analysis.Member:
if m.isDerivedFrom("Fem::FemResultObject"):
self.result_object = m
if self.result_object is not None:
if self.result_object:
self.results_present = True
else:
raise Exception('FEM: No results found at {}!'.format(frd_result_file))
Expand Down

0 comments on commit bba3543

Please sign in to comment.