You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"call of nil" exception when comparing images #8226
Today I caught a similar error when opening a commit. template: repo/diff/image_diff:14:29: executing "repo/diff/image_diff" at <call .root.FileExistsInBaseCommit .file.OldName>: error calling call: call of nil
@saitho The easiest way to reproduce this problem is to check a commit that adds an image. The problem is that the commit URL is: /{user}/{repo}/commit/{commit-sha}, and this routes into:
Thanks for your analysis. I added the missing lines (probably lost while rebasing branches) and did some minor adjustments to the image compare functionality. :D
Activity
egrekov commentedon Sep 25, 2019
Today I caught a similar error when opening a commit.
template: repo/diff/image_diff:14:29: executing "repo/diff/image_diff" at <call .root.FileExistsInBaseCommit .file.OldName>: error calling call: call of nil© Gitea Version: 1.10.0+dev-326-gc05b89a5aguillep2k commentedon Sep 26, 2019
@saitho The easiest way to reproduce this problem is to check a commit that adds an image. The problem is that the commit URL is:
/{user}/{repo}/commit/{commit-sha}, and this routes into:gitea/routers/repo/commit.go
Line 193 in f8882f4
Diff()does not setFileExistsInBaseCommit(or other image information), nor callsPrepareCompareDiff(), thus the error.I've noticed that you've authored #6784 . Is it possible for you to create a new PR fixing this problem?
Perhaps a temporary workaround is to change:
gitea/templates/repo/diff/box.tmpl
Lines 113 to 115 in f8882f4
Into something like:
Or something around those lines (I'm not quite familiar with macaron syntax).
saitho commentedon Sep 26, 2019
Thanks for your analysis. I added the missing lines (probably lost while rebasing branches) and did some minor adjustments to the image compare functionality. :D