From cd1f361c518396fdddc141442a1cd2d00f9af35b Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Fri, 19 Jul 2019 08:32:30 -0400 Subject: [PATCH] fix path assertion error --- src/pamac-tray/tray.vala | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pamac-tray/tray.vala b/src/pamac-tray/tray.vala index b2ac305..e60aa38 100644 --- a/src/pamac-tray/tray.vala +++ b/src/pamac-tray/tray.vala @@ -306,12 +306,10 @@ namespace Pamac { lockfile = GLib.File.new_for_path (daemon.get_lockfile ()); } catch (IOError e) { stderr.printf ("IOError: %s\n", e.message); - //try standard lock file - lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck"); + try_standard_lock (); } catch (DBusError e) { stderr.printf ("DBusError: %s\n", e.message); - //try standard lock file - lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck"); + try_standard_lock (); } Timeout.add (200, check_extern_lock); // wait 30 seconds before check updates @@ -325,6 +323,16 @@ namespace Pamac { this.hold (); } + private try_standard_lock () { + try { + lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck"); + } catch (IOError e) { + stderr.printf ("IOError: %s\n", e.message); + } catch (DBusError e) { + stderr.printf ("DBusError: %s\n", e.message); + } + } + public override void activate () { // nothing to do }