Commit bb6aafe8 by Jacques Germishuys

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

parent 636af219
...@@ -823,7 +823,8 @@ int git_patch__invoke_callbacks( ...@@ -823,7 +823,8 @@ int git_patch__invoke_callbacks(
for (i = 0; !error && i < git_array_size(patch->hunks); ++i) { for (i = 0; !error && i < git_array_size(patch->hunks); ++i) {
diff_patch_hunk *h = git_array_get(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) if (!line_cb)
continue; 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