Skip to content

Commit

Permalink
Fix setting of ltype to entity
Browse files Browse the repository at this point in the history
For case if ref doesn't defined
  • Loading branch information
michal-josef-spacek authored and rurban committed Mar 10, 2024
1 parent 8169cbf commit 27107af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dwg_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -21352,7 +21352,8 @@ dwg_ent_set_ltype (dwg_obj_ent *restrict ent, const char *restrict name)
return 2; // invalid name
return 1; // not found
}
if (lt_ref->absolute_ref != ent->ltype->absolute_ref)
if (!ent->ltype
|| lt_ref->absolute_ref != ent->ltype->absolute_ref)
{
// TODO preR13
if (!strcasecmp (name, "BYLAYER")) {
Expand Down

0 comments on commit 27107af

Please sign in to comment.