Fixed bug 1923254 "invisible planet crashes Celestia". The code to pick the preferred distance from a reference point wasn't checking for the case when the point had no child objects. A simple check for NULL fixed the problem.
parent
9303aa6028
commit
1033c3a7e4
|
@ -1043,7 +1043,9 @@ static double getPreferredDistance(const Selection& selection)
|
|||
// a viewpoint in which the entire system can be seen.
|
||||
if (selection.body()->getClassification() == Body::Invisible)
|
||||
{
|
||||
double r = selection.body()->getFrameTree()->boundingSphereRadius();
|
||||
double r = selection.body()->getRadius();
|
||||
if (selection.body()->getFrameTree() != NULL)
|
||||
r = selection.body()->getFrameTree()->boundingSphereRadius();
|
||||
return min(astro::lightYearsToKilometers(0.1), r * 5.0);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue