mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 01:48:18 +00:00
handle null token passed to ParseProblem
This commit is contained in:
@@ -16,7 +16,11 @@ class ParseProblem {
|
||||
* @param {Severity} severity
|
||||
*/
|
||||
constructor(token, message, severity) {
|
||||
if (Array.isArray(token)) {
|
||||
if (!token || (Array.isArray(token) && !token[0])) {
|
||||
this.startIdx = 0;
|
||||
this.endIdx = 1;
|
||||
}
|
||||
else if (Array.isArray(token)) {
|
||||
this.startIdx = token[0].range.start;
|
||||
const lastToken = token[token.length - 1];
|
||||
this.endIdx = lastToken.range.start + lastToken.range.length;
|
||||
|
||||
Reference in New Issue
Block a user