Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid pushing in currentEntityTuples if it isn't initialized. #143

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pareizaga
Copy link

The library throws an exception when loading several files generated with DG Nest because it tries to push currentEntityTuples before it is initialized. These files start with type 999 instead of 0.

999
DGNestPlus
999
DXF R12 created from "DG Nest" Tangenta Software www.tangenta-software.com
0
SECTION
...

Avoiding to push if currentEntityTuples is uninitialized solves the problem.

One of the files that gives an error is file 16 downloadable from https://tangenta-software.com/download/dxf-example-files/

@z3dev
Copy link

z3dev commented Dec 12, 2024

The current tuple (non-0) will be discarded. Is that intended? Wouldn't it be better to initialize currentEntityTuples above?

@pareizaga
Copy link
Author

It's intentional, it avoids this kind of error without changing the current behavior. But it may not be the most correct.

As you say, a better solution could be to initialize the variable before. Another possible solution would be to ignore the tuples of type 999, which are comments and not touch the behavior for the other cases.

I will modify the PR with the solution that seems best to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants