From 1ec44d63e5560d00098954890661be9fb944ada6 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Wed, 19 Oct 2011 17:39:10 -0400 Subject: Fix error handling for missing *.d/locks/ dir We were incorrectly checking for NULL as a return value from Dir.open() when that function as bound as throwing an exception on error -- so catch the exception instead. https://bugzilla.gnome.org/show_bug.cgi?id=662158 --- bin/dconf-update.vala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/dconf-update.vala b/bin/dconf-update.vala index 841fbfa..2446c16 100644 --- a/bin/dconf-update.vala +++ b/bin/dconf-update.vala @@ -42,9 +42,11 @@ unowned Gvdb.Item get_parent (Gvdb.HashTable table, string name) { } Gvdb.HashTable? read_locks_directory (string dirname) throws GLib.Error { - var dir = Dir.open (dirname); + Dir dir; - if (dir == null) { + try { + dir = Dir.open (dirname); + } catch { return null; } -- cgit v1.2.1