summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics/transaction.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-01-03 14:18:13 +0000
committerSean McGivern <sean@gitlab.com>2018-01-04 14:33:12 +0000
commit528b5eeb761f627bb1972fa8a25a09dc1cea4556 (patch)
tree4b32a5e10e331b252599fdad40e44996ab5e5421 /lib/gitlab/metrics/transaction.rb
parente5a9b9a14d32d890dea20403c977dfd569eb3e17 (diff)
downloadgitlab-ce-41468-error-500-trying-to-view-a-merge-request-json-undefined-method-binary-for-nil-nilclass.tar.gz
Old merge requests can have diffs without corresponding blobs. (This also may be possible for commit diffs in corrupt repositories.) We can't use the `&.` operator on the blobs, because the blob objects are never nil, but `BatchLoader` instances that delegate to `Blob`. We can't use `Object#try`, because `Blob` doesn't inherit from `Object`. `BatchLoader` provides a `__sync` method that returns the delegated object, but using `itself` also works because it's forwarded, and will work for non-`BatchLoader` instances too. So the simplest solution is to just use that with the `&.` operator.
Diffstat (limited to 'lib/gitlab/metrics/transaction.rb')
0 files changed, 0 insertions, 0 deletions