Avoid displaying "(null)" if things are really wrong with the registration

This commit is contained in:
Pierre Pronchery 2010-04-28 21:51:07 +00:00
parent 09efeba69d
commit df4c687bc2

View File

@ -740,7 +740,8 @@ static void _phone_set_signal_level(Phone * phone, gdouble level)
else else
{ {
level = 0.0; level = 0.0;
snprintf(buf, sizeof(buf), "%s", phone->operator); snprintf(buf, sizeof(buf), "%s", (phone->operator != NULL)
? phone->operator : "");
} }
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(phone->sy_level), level); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(phone->sy_level), level);
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(phone->sy_level), buf); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(phone->sy_level), buf);