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

Apparantly Harmless Error message #418

Closed
johnblommers opened this issue Aug 17, 2020 · 3 comments · Fixed by #420
Closed

Apparantly Harmless Error message #418

johnblommers opened this issue Aug 17, 2020 · 3 comments · Fixed by #420
Assignees
Labels
minor issue Issue: Mostly harmless

Comments

@johnblommers
Copy link

Describe the Bug

When novelWriter is launched at the command line at least two and later on more messages issue:

ERROR     No tree item with handle None

To Reproduce

Launch novelWriter at the command line. novelWriter launches. Do nothing else. Two messages issue forth back in the terminal.

Expected Behaviour

No error messages should issue.

Screenshots

Screenshot from 2020-08-17 14-24-47

Error Message

ERROR     No tree item with handle None
ERROR     No tree item with handle None

Additional Context

From the user perspective these message don't correspond to any problem. But these messages should not really emit.

@johnblommers johnblommers added the bug Issue: Something isn't working label Aug 17, 2020
@vkbo
Copy link
Owner

vkbo commented Aug 17, 2020

They are indeed harmless.

All project items are identified by a 13 digit hex hash key (handle), which can be seen in file names, in the project XML, and internally as lookup keys in the main dictionary.

The code uses None as initial values for a lot of critical variables. This helps ensure the wrong values aren't passed around, and almost all functions handle None values as a safeguard to return without performing the requested action, or use them as a fallthrough value in chains of lookups for various parameters.

The function that prints the above error has just been asked to look up a handle variable that is set to None, which of course will always fail, and return another None. I don't know exactly where the call comes from, and I plan to find out and inject an if statement to stop the message, but the None itself is handled just fine.

@vkbo vkbo self-assigned this Aug 17, 2020
@vkbo vkbo added minor issue Issue: Mostly harmless and removed bug Issue: Something isn't working labels Aug 17, 2020
@vkbo vkbo linked a pull request Aug 18, 2020 that will close this issue
@vkbo vkbo closed this as completed in #420 Aug 18, 2020
vkbo added a commit that referenced this issue Aug 18, 2020
Issue #418: Error printout in the logger
@vkbo
Copy link
Owner

vkbo commented Aug 27, 2020

Just for the sake of completeness: The error was caused by two lookups in the document footer bar (checking document status and word count) when there was no document open. This happens during initialisation, and whenever a document is closed. In both cases, the document reference value is None, because, well, there is no open document. The None value was intentional and used to tell the footer to clear the two meta data values. The logic has been altered to check for this earlier and not propagate the lookup itself in the case of a None reference.

@johnblommers
Copy link
Author

And that explains why two error messages on launch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor issue Issue: Mostly harmless
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants