Commit 5c3e01d8 by Jacques Germishuys Committed by Carlos Martín Nieto

Ensure the diff hunk callback is specified before trying to dereference it

parent fe61bb68
......@@ -822,7 +822,8 @@ int git_patch__invoke_callbacks(
for (i = 0; !error && i < git_array_size(patch->hunks); ++i) {
diff_patch_hunk *h = git_array_get(patch->hunks, i);
error = hunk_cb(patch->delta, &h->hunk, payload);
if (hunk_cb)
error = hunk_cb(patch->delta, &h->hunk, payload);
if (!line_cb)
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment