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

Bug in MissionRawImpl::set_current_mission_item_async() #1936

Closed
steveb2014 opened this issue Nov 29, 2022 · 4 comments · Fixed by #1976
Closed

Bug in MissionRawImpl::set_current_mission_item_async() #1936

steveb2014 opened this issue Nov 29, 2022 · 4 comments · Fixed by #1976
Labels

Comments

@steveb2014
Copy link

steveb2014 commented Nov 29, 2022

Found this check in the MissionRawImpl::set_current_mission_item_async method. The && should be an || and should be an easy fix.

if (index < 0 && index >= _mission_progress.last.total) {
        _parent->call_user_callback([callback]() {
            if (callback) {
                callback(MissionRaw::Result::InvalidArgument);
                return;
            }
        });
    }
@JonasVautherin
Copy link
Collaborator

Do you feel like opening a PR for it, so that you get the credit? 😇

@steveb2014
Copy link
Author

steveb2014 commented Nov 29, 2022 via email

@JonasVautherin
Copy link
Collaborator

Just ping me here if you need help or decide to give up. But I think it's worth it. It's something like this:

  1. Fork the repo
  2. Clone your forked repo (that will be your origin remote)
  3. Create a new branch for your fix, say git branch fix-mission-set-current-item
  4. Commit your changes, and push to github. In the terminal, you will see instructions for opening a PR (basically a link to open in your browser). If you miss that and open your repo in github, the UI will offer you to create a PR.
  5. Create a PR that points to mavlink/MAVSDK. Bonus: in the PR description, write "Resolves Bug in MissionRawImpl::set_current_mission_item_async() #1936".
  6. That's it, we should see it here!

@julianoes julianoes added the bug label Dec 3, 2022
@julianoes
Copy link
Collaborator

Whoops, good catch @steveb2014.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants