# HG changeset patch # User BenoƮt Allard # Date 1327327287 -3600 # Node ID 638009474a3b0ed59f2e74aa518c878c596f9d32 # Parent 78819a1b530ec97408cbf919f537067f6b115f11 api: Don't crash if the diff has no lines (in case of merge for instance) diff -r 78819a1b530e -r 638009474a3b review/api.py --- a/review/api.py Mon Jul 18 13:34:36 2011 -0400 +++ b/review/api.py Mon Jan 23 15:01:27 2012 +0100 @@ -572,6 +572,10 @@ diff_opts.git = True d = patch.diff(self.target, node1, node2, match=m, opts=diff_opts) + if not d: + # there might be no diff for the current file (merge) + continue + # patch.diff will give us back a generator with two items # the first is the diff --git header, which we don't care about d.next()