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

Check if there is a valid _activeVehical to not get a nullpointer exception #12070

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

Kaffelat
Copy link

@Kaffelat Kaffelat commented Nov 6, 2024

Check to see if activeVehicle is null as that could cause a null exception when we don't.

Description

If a null vehicle was given to a joystick on creation the start-pulling function would eventually cause a null exception when it got to the _handleAxis function because we check if _activeVehical has joystickEnabled but not if the _activeVehical null.

Test Steps

  1. Make a slot that waits for the joystickManager to send out that a new joystick have been connected
  2. Make a Vehical that is null
  3. Start polling on the newly connected joystick with the null Vehical
    Before that, the program would crash because of a null pointer exception. Now it keeps running and allows users to test the joysticks's raw value output if they desire

Checklist:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Kaffelat Kaffelat changed the title Added a check to see if activeVehicle is null as that could cause a n… Check if there is a valid _activeVehical to not get a nullpointer exception Nov 6, 2024
@HTRamsey HTRamsey merged commit 0a59f84 into mavlink:master Nov 7, 2024
7 checks passed
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