Fix error line substring bug in JellyfinAPI class

This commit is contained in:
CyferShepard
2024-03-22 10:06:03 +02:00
parent 4b7ff77533
commit bfbdbb6013

View File

@@ -65,7 +65,7 @@ class JellyfinAPI {
if (line.trim().startsWith("at")) {
const errorLine = line.trim();
const startSubstring = errorLine.lastIndexOf("\\") == -1 ? errorLine.indexOf("(") + 1 : errorLine.lastIndexOf("\\") + 1;
const endSubstring = errorLine.lastIndexOf(")") == -1 ? errorLine.length : errorLine.lastIndexOf(")") - 1;
const endSubstring = errorLine.lastIndexOf(")") == -1 ? errorLine.length : errorLine.lastIndexOf(")");
const lineNumber = errorLine.substring(startSubstring, endSubstring);
errorLines.push({ TraceIndex: index, line: lineNumber });
}