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

Don't ever delete own node from DB #3122

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Don't ever delete own node from DB #3122

merged 1 commit into from
Jan 23, 2024

Conversation

jp-bennett
Copy link
Collaborator

No description provided.

@thebentern
Copy link
Contributor

Now with less segfaults!

@thebentern thebentern merged commit 4ae5443 into master Jan 23, 2024
63 checks passed
@thebentern thebentern deleted the fix-portduino-crash branch January 23, 2024 02:13
@mverch67
Copy link
Collaborator

Now with less segfaults!

The good thing about segfaults is that it clearly indicates an issue in the software and it is easy to pinpoint on a linux system and also to fix. Much better than if issues are silently caught and ignored in the software without any notice.

@@ -204,6 +204,8 @@ int32_t PositionModule::runOnce()
}

meshtastic_NodeInfoLite *node = nodeDB.getMeshNode(nodeDB.getNodeNum());
if (node == nullptr)
return RUNONCE_INTERVAL;
Copy link
Collaborator

@mverch67 mverch67 Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be way better to also log an error here (instead of silently ignoring the fact that this get function betrayed us).
==> LOG_ERROR("getMeshNode() returned nullptr!");

Imagine we'd have dozens of this kind of code lines in the software where severe problems are simply ignored, how we're gonna pinpoint any bug in the system?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

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.

3 participants