Added warning if the planet position can not be calculated due to missing planet info

This commit is contained in:
Gergely Polonkai 2013-10-04 01:45:16 +02:00
parent c5a82b2aae
commit d261e5ab4f
1 changed files with 5 additions and 1 deletions

View File

@ -722,7 +722,11 @@ gswe_moment_calculate_planet(GsweMoment *moment, GswePlanet planet, GError **err
static void
calculate_planet(GswePlanetData *planet_data, GsweMoment *moment)
{
gswe_moment_calculate_planet(moment, planet_data->planet_info->planet, NULL);
if (planet_data->planet_info) {
gswe_moment_calculate_planet(moment, planet_data->planet_info->planet, NULL);
} else {
g_warning("planet_data holds no planet. This is a possible bug in SWE-GLib, or in your application.");
}
}
static void