diff options
| author | Vicent Martà <[email protected]> | 2013-03-08 07:09:44 -0800 |
|---|---|---|
| committer | Vicent Martà <[email protected]> | 2013-03-08 07:09:44 -0800 |
| commit | 78d105f862f117bcb9dd880dfa7b01a9e2060410 (patch) | |
| tree | 372d9bd2553d0b84366d74e3eb9232f649b534d0 /git.go | |
| parent | b57c792bf35630ba4f73388be28966ebac404432 (diff) | |
| parent | 62a16395b17460887747602a4184372a0c9a6d6f (diff) | |
Merge pull request #9 from carlosmn/nil-oid
Oid: make sure not to dereference a NULL git_oid
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -26,6 +26,10 @@ type Oid struct { } func newOidFromC(coid *C.git_oid) *Oid { + if coid == nil { + return nil + } + oid := new(Oid) copy(oid.bytes[0:20], C.GoBytes(unsafe.Pointer(coid), 20)) return oid |
