[recipes] Avoid a segfault for Anonymous recipes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Avoid a segfault for Anonymous recipes
- Date: Mon, 12 Dec 2016 13:59:50 +0000 (UTC)
commit 6a7861e638face309c5e4d055d63c2b783625cc0
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 11 21:33:34 2016 -0500
Avoid a segfault for Anonymous recipes
We can't show more recipes by Anyonymous, so just hide the link.
src/gr-details-page.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index a6ed297..89553c0 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -647,9 +647,14 @@ gr_details_page_set_recipe (GrDetailsPage *page,
gtk_label_set_label (GTK_LABEL (page->chef_label), tmp);
g_free (tmp);
- tmp = g_strdup_printf (_("More recipes by %s"), author);
- gtk_button_set_label (GTK_BUTTON (page->chef_link), tmp);
- g_free (tmp);
+ if (page->chef) {
+ gtk_widget_show (page->chef_link);
+ tmp = g_strdup_printf (_("More recipes by %s"), author);
+ gtk_button_set_label (GTK_BUTTON (page->chef_link), tmp);
+ g_free (tmp);
+ }
+ else
+ gtk_widget_hide (page->chef_link);
if (cooked > 0) {
gtk_widget_show (page->cooked_label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]