Skip to content

Commit 3808db2

Browse files
committed
in normalizeOptions, check if options exists before bothering to create 'instance'
1 parent 4ed584d commit 3808db2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils/normalize_options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ var NodeGit = require("../../");
77
* @return {Object} An Oid instance.
88
*/
99
function normalizeOptions(options, Ctor) {
10-
var instance = options instanceof Ctor ? options : new Ctor();
11-
1210
if (!options) {
1311
return null;
1412
}
1513

14+
var instance = options instanceof Ctor ? options : new Ctor();
15+
1616
Object.keys(options).forEach(function(key) {
1717
instance[key] = options[key];
1818
});

0 commit comments

Comments
 (0)