Skip to content

fix(share): Avoid crash when share owner is not found - #62791

Merged
come-nc merged 1 commit into
masterfrom
fix/fix-share-owner-not-found-crash
Aug 13, 2026
Merged

fix(share): Avoid crash when share owner is not found#62791
come-nc merged 1 commit into
masterfrom
fix/fix-share-owner-not-found-crash

Conversation

@come-nc

@come-nc come-nc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
  • Resolves: #

Summary

IShare::getNode is documented to throw only NotFoundException, so catch UserNotFoundException from the level below and wrap it. This avoids crashes from share api controller when listing shares and one of them is broken because its owner has vanished from the backend.
If this gets backported, the caught Exception should be NoUserException from OC instead.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@come-nc come-nc added this to the Nextcloud 35 milestone Aug 3, 2026
@come-nc come-nc self-assigned this Aug 3, 2026
@come-nc come-nc added bug 3. to review Waiting for reviews labels Aug 3, 2026
@come-nc

come-nc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34!

@come-nc

come-nc commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

/backport! to stable34

@come-nc
come-nc force-pushed the fix/fix-share-owner-not-found-crash branch from 15ebe37 to ff53d0a Compare August 6, 2026 07:05
@come-nc
come-nc marked this pull request as ready for review August 6, 2026 07:08
@come-nc
come-nc requested a review from a team as a code owner August 6, 2026 07:08
@come-nc
come-nc requested review from Altahrim, leftybournes, provokateurin and salmart-dev and removed request for a team August 6, 2026 07:08
@come-nc
come-nc requested a review from CarlSchwan August 11, 2026 14:26
IShare::getNode is documented to throw only NotFoundException, so catch
 UserNotFoundException from the level below and wrap it. This avoids
 crashes from share api controller when listing shares and one of them
 is broken because its owner has vanished from the backend.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-nc force-pushed the fix/fix-share-owner-not-found-crash branch from ff53d0a to 40be022 Compare August 11, 2026 14:30
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 12, 2026
@come-nc
come-nc merged commit c3e45f8 into master Aug 13, 2026
199 checks passed
@come-nc
come-nc deleted the fix/fix-share-owner-not-found-crash branch August 13, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants