Fix 500 error on diff if file permission changed
Merge branch 'fix-diff-500' into 'master'

Fix 500 when viewing diff if a file changed permission

Fixes #1613

See merge request !1109