diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-10-19 17:39:10 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-10-19 17:39:10 -0400 |
commit | 1ec44d63e5560d00098954890661be9fb944ada6 (patch) | |
tree | 90aabd164e6c0d5dbea783936f6e8cbc96b755c0 | |
parent | 8bd03b799e6efa97bf4df2cc5093f5d3e9964c28 (diff) | |
download | dconf-1ec44d63e5560d00098954890661be9fb944ada6.tar.gz |
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
-rw-r--r-- | bin/dconf-update.vala | 6 |
1 files 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; } |