[gitg] Try/catch get_head_commit



commit 5d876108ca86a514b2bf5bd13f18675b1fce9649
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sun Jul 7 16:27:05 2013 +0200

    Try/catch get_head_commit

 gitg/commit/gitg-commit.vala |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/gitg/commit/gitg-commit.vala b/gitg/commit/gitg-commit.vala
index c6e0d42..600669a 100644
--- a/gitg/commit/gitg-commit.vala
+++ b/gitg/commit/gitg-commit.vala
@@ -486,15 +486,18 @@ namespace GitgCommit
                {
                        Gitg.Commit? retval = null;
 
-                       yield Gitg.Async.thread(() => {
-                               var repo = application.repository;
+                       try
+                       {
+                               yield Gitg.Async.thread(() => {
+                                       var repo = application.repository;
 
-                               try
-                               {
-                                       var head = repo.get_head();
-                                       retval = repo.lookup<Gitg.Commit>(head.get_target());
-                               } catch {}
-                       });
+                                       try
+                                       {
+                                               var head = repo.get_head();
+                                               retval = repo.lookup<Gitg.Commit>(head.get_target());
+                                       } catch {}
+                               });
+                       } catch {}
 
                        return retval;
                }


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