From c5232cc938ec9170741932b441c92fffddbc56e6 Mon Sep 17 00:00:00 2001 From: Kevin Wasserman Date: Fri, 18 Oct 2013 12:22:33 -0400 Subject: [PATCH] Don't try to use gtk when it is not initialized. --- src/moonshot-identity-manager-app.vala | 1 + src/moonshot-utils.vala | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/moonshot-identity-manager-app.vala b/src/moonshot-identity-manager-app.vala index c8ad666..52251ca 100644 --- a/src/moonshot-identity-manager-app.vala +++ b/src/moonshot-identity-manager-app.vala @@ -354,6 +354,7 @@ public static int main(string[] args){ stdout.printf(_("Run '%s --help' to see a full list of available options\n"), args[0]); return -1; } + gtk_available = true; } #if OS_WIN32 diff --git a/src/moonshot-utils.vala b/src/moonshot-utils.vala index b6e4410..5f59343 100644 --- a/src/moonshot-utils.vala +++ b/src/moonshot-utils.vala @@ -14,8 +14,12 @@ public Gdk.Pixbuf? find_icon_sized (string name, Gtk.IconSize icon_size) * load them manually. */ +public bool gtk_available = false; + public Gdk.Pixbuf? find_icon (string name, int size) { + if (!gtk_available) + return null; try { #if OS_WIN32 -- 2.1.4