[gnome-builder] eslint: Don't crash if eslint message does not contain a line
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] eslint: Don't crash if eslint message does not contain a line
- Date: Sun, 26 Nov 2017 02:23:29 +0000 (UTC)
commit 8ba1533dd22d2d50d8b80f32c2ccb75dda14e23a
Author: Giovanni Campagna <gcampagn cs stanford edu>
Date: Sat Nov 25 16:17:29 2017 -0800
eslint: Don't crash if eslint message does not contain a line
Just skip the message and process the rest of the output
https://bugzilla.gnome.org/show_bug.cgi?id=790834
src/plugins/eslint/eslint_plugin.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/eslint/eslint_plugin.py b/src/plugins/eslint/eslint_plugin.py
index fbae269..a6926a1 100644
--- a/src/plugins/eslint/eslint_plugin.py
+++ b/src/plugins/eslint/eslint_plugin.py
@@ -94,6 +94,8 @@ class ESLintDiagnosticProvider(Ide.Object, Ide.DiagnosticProvider):
results = json.loads(stdout)
for result in results:
for message in result.get('messages', []):
+ if 'line' not in message or 'column' not in message:
+ continue
start_line = max(message['line'] - 1, 0)
start_col = max(message['column'] - 1, 0)
start = Ide.SourceLocation.new(file, start_line, start_col, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]