fix: guard startSyncFolderOperation against a null folder (#4738) - #4986
Merged
joragua merged 2 commits intoSep 29, 2026
Merged
Conversation
joragua
requested changes
Sep 25, 2026
Member
There was a problem hiding this comment.
Thanks for this contribution @ibrahim-iqbal! 👌🏻 The first CR is here!
Do not forget to split the changes into two commit: one for the fix and another one for the calens file (chore: add calens file). Moreover, all commits must be signed. Otherwise, we will not be able to merge this PR.
Let us know if you have any doubts!
Signed-off-by: ibrahim-iqbal <ibrahim-iqbal@users.noreply.github.com>
ibrahim-iqbal
force-pushed
the
fix/npe-receive-external-files-4738
branch
from
September 26, 2026 12:05
692d2e2 to
2698bec
Compare
Contributor
Author
|
Hey @joragua! 👋 All feedback addressed in
Let me know if anything else needs adjusting! 🚀 |
joragua
approved these changes
Sep 29, 2026
Member
|
CI passes, that's enough for the moment. Will check when next release is out, and no more appearances in GPC. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
App: closes #4738
ReceiveExternalFilesViewModel.refreshFolderUseCase(folderToSync: OCFile)is a Kotlin function with a non-null parameter.ReceiveExternalFilesActivity.startSyncFolderOperationforwarded whatever came in without a null check, so the two entry points that can hand back a null folder crashed with the Kotlin platform-type NPE reported in issue #4738:onSavedCertificate()→startSyncFolderOperation(getCurrentDir()), andFileActivity.getCurrentDir()returnsnullwhengetFile()is null, when the current file isn't a folder and the storage manager is missing, or when the storage manager can't resolve the parent path (FileActivity.java:455-466).refreshFolderUseCase (Unknown Source:6)is the Kotlin null check on the parameter.Changes
ReceiveExternalFilesActivity.startSyncFolderOperation: short-circuit and log via Timber whenfolderis null instead of forwarding to Kotlin.Kept every other caller unchanged —
onBackPressed(line 471),onItemClick(line 500), and the initial spaces-root call (line 259) already null-check the folder they pass in, so no other site needed the guard.Changelog file at
changelog/unreleased/4738(Bugfix:type).Release Notes in
ReleaseNotesViewModel.kt— crash-only, not a user-visible feature; happy to add one if you'd prefer.QA
./gradlew :owncloudApp:compileOriginalDebugJavaWithJavac→ BUILD SUCCESSFUL.startSyncFolderOperationhad to change; grep confirms four call sites and the three that aren'tgetCurrentDir()already guard the value.