diff options
author | Marius Kintel <marius@kintel.net> | 2010-07-08 22:46:56 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:37 (GMT) |
commit | a38cd8d0f121c98432a548edb024310b7b5b6265 (patch) | |
tree | 6f8fc22f473cd4f32603fcf70e2a1dee3b363050 /src | |
parent | dee4f85572c63dbbdc39efc072ba81b37be7ea45 (diff) |
bugfix: render_polyset() returned NULL when DAT file wasn't found -> crash
Diffstat (limited to 'src')
-rw-r--r-- | src/surface.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/surface.cc b/src/surface.cc index afaaeb0..a4aa0a5 100644 --- a/src/surface.cc +++ b/src/surface.cc @@ -92,12 +92,13 @@ void register_builtin_surface() PolySet *SurfaceNode::render_polyset(render_mode_e) const { + PolySet *p = new PolySet(); handle_dep(filename); QFile f(filename); if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { PRINTF("WARNING: Can't open DAT file `%s'.", filename.toAscii().data()); - return NULL; + return p; } int lines = 0, columns = 0; @@ -124,7 +125,6 @@ PolySet *SurfaceNode::render_polyset(render_mode_e) const lines++; } - PolySet *p = new PolySet(); p->convexity = convexity; double ox = center ? -columns/2.0 : 0; |