Skip to content

Commit e44e747

Browse files
author
John Haley
committed
Apparently you should only null check pointers
1 parent 8c9ff07 commit e44e747

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

generate/partials/sync_function.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ from_{{ arg.name }}
5555
{%if not .|returnsCount %}
5656
NanReturnUndefined();
5757
{%else%}
58+
{%if return.cType | isPointer %}
59+
// null checks on pointers
5860
if (!result) {
59-
NodeGitPsueodoNanReturnEscapingValue(NanNull());
61+
NodeGitPsueodoNanReturnEscapingValue(NanUndefined());
6062
}
63+
{%endif%}
6164

6265
Handle<Value> to;
6366
{%if .|returnsCount > 1 %}

test/tests/attr.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var assert = require("assert");
22
var path = require("path");
33

4-
describe("Blob", function() {
4+
describe("Attr", function() {
55
var reposPath = path.resolve("test/repos/workdir/.git");
66

77
var Repository = require("../../lib/repository");
@@ -29,11 +29,11 @@ describe("Blob", function() {
2929
it.skip("can lookup the value of a git attribute", function() {
3030
var flags = Attr.Check.NO_SYSTEM;
3131
var getAttr = Attr.get(this.repository, flags, ".gitattributes", "test");
32-
32+
3333
return getAttr.then(function(val) {
3434
console.log(val);
3535
}).catch(function(ex) {
36-
console.log(ex);
36+
console.log(ex);
3737
});
3838
});
3939
});

test/tests/remote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe("Remote", function() {
6161
});
6262
});
6363

64-
it.only("can push a remote", function() {
64+
it("can push a remote", function() {
6565
return Remote.load(this.repository, "origin").then(function(remote) {
6666
assert(remote.pushurl(), "https://github.com/nodegit/nodegit");
6767
});

0 commit comments

Comments
 (0)