4688: diff fragment cannot be displayed

Misery
4765

What version are you running?

3.0.5

What's the URL of the page containing the problem?

https://reviewboard/r/12256/#comment19826

What steps will reproduce the problem?

  1. Create a review request with this patch
  2. Let a review bot create an issue for that line
  3. Show diff fragments

I cannot see the line number of the issue. Maybe the review bot added a line number that cannot be displayed in diff fragment???

What is the expected output? What do you see instead?

There was an error displaying this diff.

Traceback (most recent call last):
File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/reviews/views.py", line 381, in build_diff_comment_fragments
first_line = max(1, comment.first_line - lines_of_context[0])
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

What operating system are you using? What browser?

Linux, Firefox

Please provide any additional information below.

diff --git a/app/src/test/java/com/companyname/instantbankshowcase/ExampleUnitTest.java b/app/src/test/java/com/companyname/demobank/ExampleUnitTest.java
rename from app/src/test/java/com/companyname/instantbankshowcase/ExampleUnitTest.java
rename to app/src/test/java/com/companyname/demobank/ExampleUnitTest.java
--- a/app/src/test/java/com/companyname/instantbankshowcase/ExampleUnitTest.java
+++ b/app/src/test/java/com/companyname/demobank/ExampleUnitTest.java
@@ -1,4 +1,4 @@
-package com.companyname.instantbankshowcase;
+package com.companyname.demobank;

import org.junit.Test;

psimms
#1 psimms

We are seeing this same issue on our reviewboard server 3.0.10

Was on a reviewbot cppcheck of a c++ file, the review shows this error in place of the diff

There was an error displaying this diff.
unsupported operand type(s) for -: 'NoneType' and 'int'

This may be a a temporary outage or an issue with the format of your diff.

Please try again, and if you still have trouble, contact support.

Details
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/reviewboard/reviews/views.py", line 381, in build_diff_comment_fragments
first_line = max(1, comment.first_line - lines_of_context[0])
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

And this is the cppcheck output for the diff in question

Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.".

Category: information
Sub Category: toomanyconfigs

Misery
#2 Misery

Yeah, I already created a duplicate of myself as I don't remember this report: https://hellosplat.com/s/beanbag/tickets/4765/