Skip to content

fix: handle null from ExtendedSSLSession.getRequestedServerNames (#9523) - #9663

Open
waterWang wants to merge 1 commit into
lysine-dev:mainfrom
waterWang:fix-null-getrequestedservernames
Open

fix: handle null from ExtendedSSLSession.getRequestedServerNames (#9523)#9663
waterWang wants to merge 1 commit into
lysine-dev:mainfrom
waterWang:fix-null-getrequestedservernames

Conversation

@waterWang

Copy link
Copy Markdown

Fix: handle null from ExtendedSSLSession.getRequestedServerNames()

On some Android versions (SDK 27, 28), ExtendedSSLSession.getRequestedServerNames() can return null instead of an empty list. This causes a NullPointerException when MockWebServer records the handshakeServerNames in RecordedRequest.

Changes

In Platform.kt, use (session.requestedServerNames ?: emptyList()) instead of session.requestedServerNames directly to handle the null case gracefully.

Related

Closes #9523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled null return from ExtendedSSLSession.getRequestedServerNames

1 participant