diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-08 21:32:56 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2009-04-08 21:32:56 +0400 |
commit | 997624c7ddad836080e54d5b488169954bc77b35 (patch) | |
tree | da0fce8924de795d07bfcd24db6743270b416545 /source/blender/freestyle/intern/stroke/StyleModule.h | |
parent | 5dd39e651703249252f9c461031205fc22c90fd2 (diff) |
Corrected crash when calculating number of available style modules
Diffstat (limited to 'source/blender/freestyle/intern/stroke/StyleModule.h')
-rwxr-xr-x | source/blender/freestyle/intern/stroke/StyleModule.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h index 3d39e53515b..390a67d633d 100755 --- a/source/blender/freestyle/intern/stroke/StyleModule.h +++ b/source/blender/freestyle/intern/stroke/StyleModule.h @@ -61,12 +61,25 @@ public: cerr << "Error: no interpreter was found to execute the script" << endl; return NULL; } + + if (!_drawable) { + cerr << "Error: not drawable" << endl; + return NULL; + } + Operators::reset(); - if (_inter->interpretFile(_file_name)) + int errorCode; + if( errorCode = _inter->interpretFile(_file_name)) { + cerr << "Error: interpretation failed with code " << errorCode << endl; return NULL; + } + Operators::StrokesContainer* strokes_set = Operators::getStrokesSet(); - if (!_drawable || strokes_set->empty()) + if( strokes_set->empty() ) { + cerr << "Error: strokes set empty" << endl; return NULL; + } + StrokeLayer* sl = new StrokeLayer; for (Operators::StrokesContainer::iterator it = strokes_set->begin(); it != strokes_set->end(); |