Page MenuHomePhabricator

D21290.id50699.diff
No OneTemporary

D21290.id50699.diff

diff --git a/src/lint/renderer/ArcanistConsoleLintRenderer.php b/src/lint/renderer/ArcanistConsoleLintRenderer.php
--- a/src/lint/renderer/ArcanistConsoleLintRenderer.php
+++ b/src/lint/renderer/ArcanistConsoleLintRenderer.php
@@ -146,11 +146,16 @@
$char - 1,
strlen($original));
- $new_lines[$start - 1] = substr_replace(
- $new_lines[$start - 1],
- $this->highlightText($replacement),
- $char - 1,
- strlen($replacement));
+ // See T13543. The message may have completely removed this line: for
+ // example, if it trimmed trailing spaces from the end of a file. If
+ // the line no longer exists, don't try to highlight it.
+ if (isset($new_lines[$start - 1])) {
+ $new_lines[$start - 1] = substr_replace(
+ $new_lines[$start - 1],
+ $this->highlightText($replacement),
+ $char - 1,
+ strlen($replacement));
+ }
}
// If lines at the beginning of the changed line range are actually the

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 1:11 PM (9 h, 18 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6800642
Default Alt Text
D21290.id50699.diff (1 KB)

Event Timeline