Add error reporting to add_points()

It is possible that planet_data->sign_info is NULL, which results in
a SEGFAULT.
This commit is contained in:
Gergely Polonkai 2014-09-02 11:56:10 +02:00
parent 366155b835
commit 06fce9c9d5

View File

@ -1156,7 +1156,17 @@ add_points(GswePlanetData *planet_data, GsweMoment *moment)
);
sign_info = gswe_planet_data_get_sign_info(planet_data);
if (G_UNLIKELY(sign_info == NULL)) {
g_error("Planet data calculation failed");
}
planet_info = gswe_planet_data_get_planet_info(planet_data);
if (G_UNLIKELY(planet_info == NULL)) {
g_error("Planet data calculation failed. No planet info.");
}
element = gswe_sign_info_get_element(sign_info);
point = GPOINTER_TO_INT(g_hash_table_lookup(
moment->priv->element_points,