diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala index 05339ebfedc1e..a3c639d47da63 100644 --- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala +++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala @@ -83,7 +83,7 @@ class HistoryServer( } val appId = parts(1) - val attemptId = if (parts.length > 3) Some(parts(2)) else None + val attemptId = if (parts.length >= 3) Some(parts(2)) else None // Since we may have applications with multiple attempts mixed with applications with a // single attempt, we need to try both. Try the single-attempt route first, and if an