Fix javascript errors when changing diff revisions too fast.
Review Request #6280 — Created Aug. 27, 2014 and submitted
When the diff revision sliders are moved before all the files on a page finish
loading, it can cause a javascript error. The cause here is that the
DiffReviewable has an outstanding fetch, which attempts to render the file once
it finishes. If the element disappears, we try to dereference things which are
now undefined. I've made it test to see whether the target element is present
before creating the DiffReviewableView, which avoids all of the problems.
Flipped around to a bunch of different diff revisions, changing things before
all files loaded. After this change, everything works swimmingly.
Description | From | Last Updated |
---|---|---|
Indentation is off. Should be unindented one level. |
chipx86 |