[gnome-commander] Don't signal-connect to the gFileMonitor if it is null



commit 5654449c6270f14c135566f4ca55d65619ae7933
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Tue Oct 12 22:03:29 2021 +0200

    Don't signal-connect to the gFileMonitor if it is null

 src/gnome-cmd-dir.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 0ad8a403..256d5e89 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -807,8 +807,6 @@ void gnome_cmd_dir_start_monitoring (GnomeCmdDir *dir)
             nullptr,
             &error);
 
-        g_signal_connect (gFileMonitor, "changed", G_CALLBACK (monitor_callback), dir);
-
         if (error)
         {
             DEBUG ('n', "Failed to add monitor to %p %s: %s\n", dir, uri_str, error->message);
@@ -817,6 +815,8 @@ void gnome_cmd_dir_start_monitoring (GnomeCmdDir *dir)
             return;
         }
 
+        g_signal_connect (gFileMonitor, "changed", G_CALLBACK (monitor_callback), dir);
+
         DEBUG('n', "Added monitor to %p %s\n", dir, uri_str);
         dir->priv->gFileMonitor = gFileMonitor;
         g_free (uri_str);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]