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 null pointer exception in the flight plan and avoid UI flickering #2131

Merged
merged 6 commits into from
Apr 11, 2019

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Apr 10, 2019

No description provided.

pleroy added 5 commits April 9, 2019 23:04

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@@ -413,13 +440,12 @@ class FlightPlanner : SupervisedWindowRenderer {
return true;
}

// Not owned.
Copy link
Member

Choose a reason for hiding this comment

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

That comment should have been on plugin_, but it still applies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@@ -266,8 +280,7 @@ class FlightPlanner : SupervisedWindowRenderer {
for (int i = 0; i < burn_editors_.Count; ++i) {
NavigationManoeuvre manoeuvre =
plugin_.FlightPlanGetManoeuvre(vessel_guid, i);
// TODO(phl): Evil changes of widgets between layout and repaint...
if (manoeuvre.final_time > current_time) {
if (first_future_manoeuvre_.HasValue && i >= first_future_manoeuvre_) {
Copy link
Member

Choose a reason for hiding this comment

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

if (i >= first_future_manoeuvre_), null compares false with non-null values.

Copy link
Member Author

Choose a reason for hiding this comment

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

OBE.

@@ -266,8 +280,7 @@ class FlightPlanner : SupervisedWindowRenderer {
for (int i = 0; i < burn_editors_.Count; ++i) {
Copy link
Member

Choose a reason for hiding this comment

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

Since we have computed first_future_manoeuvre_ already, could we not get rid of the loop, and just do it for i == first_future_manoeuvre_?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@eggrobin eggrobin added the LGTM label Apr 11, 2019
@pleroy
Copy link
Member Author

pleroy commented Apr 11, 2019

retest this please

@pleroy pleroy merged commit 08814d6 into mockingbirdnest:master Apr 11, 2019
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 this pull request may close these issues.

None yet

2 participants