Fix InputStream leak in UploadModel.buildContributions() - #6861
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses Issue #6853 by ensuring the InputStream opened in UploadModel.buildContributions() is reliably closed, preventing resource leaks during SHA1 computation for uploads.
Changes:
- Wraps
ContentResolver.openInputStream(...)in a Kotlinuse {}block when computing the image SHA1. - Adds a null-handling fallback when
openInputStream(...)returnsnull.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d34afc8 to
df51c94
Compare
|
✅ Generated APK variants! |
|
In the interest of being consistent with what we said on #6853: re-checked |
Description (required)
Wrapped the InputStream initialization in a Kotlin .use block to guarantee safe resource closure
Fixes #6853
Tests performed (required)
Tested 6.5.0-debug on Pixel 9(Android 16)