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

Remove unnecessary null pointer checks #3767

Open
elfring opened this issue Dec 8, 2020 · 3 comments
Open

Remove unnecessary null pointer checks #3767

elfring opened this issue Dec 8, 2020 · 3 comments
Labels
easy start This issue is a good start for someone new to Fritzing.

Comments

@elfring
Copy link

elfring commented Dec 8, 2020

An extra null pointer check is not needed in functions like the following.

@KjellMorgenstern
Copy link
Member

KjellMorgenstern commented Dec 8, 2020

Indeed, it is safe to call delete null_ptr .
Also PartsBinPalette might set m_icon to nullptr after deleting.
Are you working on a PR?

@KjellMorgenstern KjellMorgenstern added the easy start This issue is a good start for someone new to Fritzing. label Dec 8, 2020
@elfring
Copy link
Author

elfring commented Dec 8, 2020

@KjellMorgenstern
Copy link
Member

Of course, use it. I do. But still, fixes should not break anything. This is problematic without automated tests: Reviewing a fix for a harmless warning takes often more time than fixing an actual real bug that had been reported on github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy start This issue is a good start for someone new to Fritzing.
Projects
None yet
Development

No branches or pull requests

2 participants