From 3677b43f8b1d3f43441c26ebaf43a08a4cfce417 Mon Sep 17 00:00:00 2001 From: Peter Hill Date: Thu, 22 Apr 2021 18:03:12 +0100 Subject: [PATCH] Fix for when diff has "No newline at end of file" These lines are sort of separate from the diff somehow? But shouldn't be included in the lookup table anyway --- review.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/review.py b/review.py index 4d4519b..8c47a56 100755 --- a/review.py +++ b/review.py @@ -34,6 +34,8 @@ def make_file_line_lookup(diff): lookup[filename] = {} for hunk in file: for line in hunk: + if line.diff_line_no is None: + continue if not line.is_removed: lookup[filename][line.target_line_no] = ( line.diff_line_no - DIFF_HEADER_LINE_LENGTH