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

Fix: NPE when directly launching an application #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ppmathis
Copy link
Member

While working on something else I noticed that it is no longer possible to directly launch an application by specifying it as the first argument, e.g. by running with the property -Dcrowpi.launcher.args=BuzzerApp. Reason for that behavior is that directly calling an application will bypass the run() method, meaning that the context stored in pi4j does not get initialized and therefor causes a NullPointerException.

This PR ensures that a context is always created, but also cleaned up properly after every execution. To avoid this from happening again, I've added a test case covering this scenario as well.

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.

1 participant