Add more guards to aspect calculations

gswe_aspect_data_calculate() may get called if the currently set
planet is NULL
This commit is contained in:
Gergely Polonkai 2014-11-13 01:13:11 +01:00
parent 4d5866b405
commit bf5a839511

View File

@ -230,7 +230,7 @@ gswe_aspect_data_set_planet1(
aspect_data->planet1 = gswe_planet_data_ref(planet1);
if (aspect_data->planet2) {
if (planet1 && aspect_data->planet2) {
gswe_aspect_data_calculate(aspect_data);
}
}
@ -268,7 +268,7 @@ gswe_aspect_data_set_planet2(
aspect_data->planet2 = gswe_planet_data_ref(planet2);
if (aspect_data->planet1) {
if (aspect_data->planet1 && planet2) {
gswe_aspect_data_calculate(aspect_data);
}
}