Skip to content

Commit

Permalink
changes is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Apr 11, 2017
1 parent 1933fd1 commit ced3369
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion whatthepatch/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def apply_diff(diff, text, reverse=False, use_patch=False):

n_lines = len(lines)

changes = _reverse(diff.changes) if reverse else diff.changes
changes = diff.changes or []
changes = _reverse(changes) if reverse else changes
# check that the source text matches the context of the diff
for old, new, hunk, line in changes:
# might have to check for line is None here for ed scripts
Expand Down

0 comments on commit ced3369

Please sign in to comment.