Skip to content

Commit 14b7e32

Browse files
committed
[KYUUBI #6534] Fix checkEngineConnectionAlive may throw NPE
# 🔍 Description ## Issue References 🔗 This pull request fixes #6534 ## Describe Your Solution 🔧 check null ahead. ## Types of changes 🔖 - [x] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 Pass GHA --- # Checklist 📝 - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6540 from pan3793/client-npe. Closes #6534 6976cd3 [Cheng Pan] [KYUUBI #6534] Fix checkEngineConnectionAlive may throw NPE Authored-by: Cheng Pan <[email protected]> Signed-off-by: Cheng Pan <[email protected]> (cherry picked from commit 7336fbc) Signed-off-by: Cheng Pan <[email protected]>
1 parent 6ee77dc commit 14b7e32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ class KyuubiSessionImpl(
315315
}
316316

317317
def checkEngineConnectionAlive(): Boolean = {
318-
if (Option(client).exists(_.engineConnectionClosed)) return false
318+
if (client == null) return true // client has not been initialized
319+
if (client.engineConnectionClosed) return false
319320
!client.remoteEngineBroken
320321
}
321322
}

0 commit comments

Comments
 (0)