[file-roller] ignore clipboard and actions if they are null
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] ignore clipboard and actions if they are null
- Date: Sun, 3 Mar 2019 08:56:28 +0000 (UTC)
commit 67d2081f9b1f54b44304bd7b3db9777cdcce1b44
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Mar 3 09:39:40 2019 +0100
ignore clipboard and actions if they are null
should mitigate https://gitlab.gnome.org/GNOME/file-roller/issues/31
src/fr-window.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index 35ae8646..efa343bc 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -688,7 +688,8 @@ fr_window_enable_action (FrWindow *window,
GAction *action;
action = g_action_map_lookup_action (G_ACTION_MAP (window), action_name);
- g_object_set (action, "enabled", enabled, NULL);
+ if (action != NULL)
+ g_object_set (action, "enabled", enabled, NULL);
}
@@ -700,7 +701,8 @@ fr_window_set_action_state (FrWindow *window,
GAction *action;
action = g_action_map_lookup_action (G_ACTION_MAP (window), action_name);
- g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (active));
+ if (action != NULL)
+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (active));
}
@@ -741,6 +743,9 @@ fr_window_update_paste_command_sensitivity (FrWindow *window,
if (clipboard == NULL)
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), _fr_window_get_clipboard_name
(window));
+ if (clipboard == NULL)
+ return;
+
running = window->priv->activity_ref > 0;
no_archive = (window->archive == NULL) || ! window->priv->archive_present;
ro = ! no_archive && window->archive->read_only;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]