-
Notifications
You must be signed in to change notification settings - Fork 69
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
Conversation
@@ -413,13 +440,12 @@ class FlightPlanner : SupervisedWindowRenderer { | |||
return true; | |||
} | |||
|
|||
// Not owned. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin_adapter/flight_planner.cs
Outdated
@@ -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_) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OBE.
ksp_plugin_adapter/flight_planner.cs
Outdated
@@ -266,8 +280,7 @@ class FlightPlanner : SupervisedWindowRenderer { | |||
for (int i = 0; i < burn_editors_.Count; ++i) { |
There was a problem hiding this comment.
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_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
retest this please |
No description provided.