Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTOR-7952 Fix for uninitialized writerJob property #4559

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

bjhham
Copy link
Contributor

@bjhham bjhham commented Dec 17, 2024

Subsystem
Client, SaveBody

Motivation
KTOR-7952 SaveBodyPlugin: UninitializedPropertyAccessException when reading response body within receivePipeline

Solution
Using a lazy delegate instead of a lateinit variable will make it so it will always get initialized - either from copyTask.start() or from awaitImpatiently().

@bjhham bjhham force-pushed the bjhham/lateinit-writerjob-fix branch 2 times, most recently from 085bf3b to cfba409 Compare December 17, 2024 13:49
@bjhham bjhham force-pushed the bjhham/lateinit-writerjob-fix branch from 072f3a2 to 665163b Compare December 18, 2024 12:05
@bjhham bjhham requested a review from osipxd December 18, 2024 14:35
Copy link
Member

@osipxd osipxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, "good" old lateinit.. 👍

@osipxd osipxd mentioned this pull request Dec 19, 2024
@bjhham bjhham merged commit 23eee5a into main Dec 19, 2024
16 checks passed
@bjhham bjhham deleted the bjhham/lateinit-writerjob-fix branch December 19, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants