Skip to content

Commit

Permalink
Check for bot before deferencing
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Jan 19, 2024
1 parent 7192a67 commit 6de1dfa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/libged/facetize/tessellate/continuation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,12 @@ continuation_mesh(struct rt_bot_internal **obot, struct db_i *dbip, const char *
bu_log("CM: successfully polygonized BoT with %d faces at feature size %g\n", (int)bot->num_faces, successful_feature_size);
}

if (!bot->faces) {
if (!bot || !bot->faces) {
bu_log("CM: surface reconstruction failed: %s\n", objname);
if (bot->vertices) bu_free(bot->vertices, "verts");
if (bot->faces) bu_free(bot->faces, "verts");
BU_PUT(bot, struct rt_bot_internal *);
if (bot && bot->vertices) bu_free(bot->vertices, "verts");
if (bot && bot->faces) bu_free(bot->faces, "verts");
if (bot)
BU_PUT(bot, struct rt_bot_internal *);
return BRLCAD_ERROR;
}

Expand Down

0 comments on commit 6de1dfa

Please sign in to comment.