[libgit2-glib] blame-options: avoid possible null deferences
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] blame-options: avoid possible null deferences
- Date: Fri, 5 Aug 2016 08:42:03 +0000 (UTC)
commit 1e873f4e022675e8a84d93e10615497854bf2e5c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Aug 5 10:41:45 2016 +0200
blame-options: avoid possible null deferences
libgit2-glib/ggit-blame-options.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libgit2-glib/ggit-blame-options.c b/libgit2-glib/ggit-blame-options.c
index 45b1ef9..d351208 100644
--- a/libgit2-glib/ggit-blame-options.c
+++ b/libgit2-glib/ggit-blame-options.c
@@ -175,8 +175,10 @@ ggit_blame_options_set_newest_commit (GgitBlameOptions *blame_options,
{
blame_options->blame_options.newest_commit = zero;
}
-
- blame_options->blame_options.newest_commit = *_ggit_oid_get_oid (oid);
+ else
+ {
+ blame_options->blame_options.newest_commit = *_ggit_oid_get_oid (oid);
+ }
}
/**
@@ -224,8 +226,10 @@ ggit_blame_options_set_oldest_commit (GgitBlameOptions *blame_options,
{
blame_options->blame_options.oldest_commit = zero;
}
-
- blame_options->blame_options.oldest_commit = *_ggit_oid_get_oid (oid);
+ else
+ {
+ blame_options->blame_options.oldest_commit = *_ggit_oid_get_oid (oid);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]