Skip to content

fix(chat): Avoid NPE when opening a file attachment in the Files app - #6596

Merged
mahibi merged 1 commit into
masterfrom
bugfix/noid/fixNpeInOpenInFilesApp
Aug 27, 2026
Merged

fix(chat): Avoid NPE when opening a file attachment in the Files app#6596
mahibi merged 1 commit into
masterfrom
bugfix/noid/fixNpeInOpenInFilesApp

Conversation

@mahibi

@mahibi mahibi commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

message.activeUser is a deprecated field that is no longer populated for messages loaded via chatViewModel.getMessageById(), causing openInFilesApp to crash on the !! assertion. Use the activity's own conversationUser instead, and guard against empty file id/link.

solves the crash

Exception java.lang.NullPointerException:
  at com.nextcloud.talk.chat.ChatActivity.openInFilesApp (ChatActivity.kt:3924)
  at com.nextcloud.talk.chat.ChatActivity.setChatListContent$lambda$0$0$25$5$16$0 (ChatActivity.kt:1073)
  at com.nextcloud.talk.chat.ChatActivity.$r8$lambda$gNw-gM-0_WBUE332dY-UQ59gx9A (ChatActivity.kt)
  at com.nextcloud.talk.chat.ChatActivity$$ExternalSyntheticLambda82.invoke (D8$$SyntheticClass)
  at com.nextcloud.talk.chat.ui.MessageActionsBottomSheetKt.MessageActionsSheetContent$lambda$3$1$15$0 (MessageActionsBottomSheet.kt:573)
  at com.nextcloud.talk.chat.ui.MessageActionsBottomSheetKt.$r8$lambda$U1EpqISFzC9zioliU6v53FiRDwI (MessageActionsBottomSheet.kt)

Assisted-by: Claude:claude-sonnet-5

馃弫 Checklist

  • 鉀戯笍 Tests (unit and/or integration) are included or not needed
  • 馃敄 Capability is checked or not needed
  • 馃敊 Backport requests are created or not needed: /backport to stable-xx.x
  • 馃搮 Milestone is set
  • 馃尭 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

馃 AI (if applicable)

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

message.activeUser is a deprecated field that is no longer populated
for messages loaded via chatViewModel.getMessageById(), causing
openInFilesApp to crash on the !! assertion. Use the activity's own
conversationUser instead, and guard against empty file id/link.

Assisted-by: Claude:claude-sonnet-5

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added this to the 25.1.0 milestone Aug 27, 2026
@mahibi
mahibi requested a review from rapterjet2004 August 27, 2026 10:03
@mahibi mahibi self-assigned this Aug 27, 2026
@mahibi mahibi added the 3. to review Waiting for reviews label Aug 27, 2026
@mahibi

mahibi commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-25.0.x

@github-actions

Copy link
Copy Markdown
Contributor

APK file: https://github.com/nextcloud/talk-android/actions/runs/33061356945/artifacts/9644861476
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@mahibi
mahibi merged commit d181510 into master Aug 27, 2026
20 of 21 checks passed
@mahibi
mahibi deleted the bugfix/noid/fixNpeInOpenInFilesApp branch August 27, 2026 15:50
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 AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants