Skip to content

Commit 8af04aa

Browse files
committed
fix crash caused by updateScheduledMessagesAvailability (e.g. by screen rotation)
binding was not initialized. crash: 2026-01-29 09:58:13.087 3875-3875 TransactionExecutor com.nextcloud.talk2 E Failed to execute the transaction: tId:1538356034 ClientTransaction{ tId:1538356034 transactionItems=[ tId:1538356034 ConfigurationChangeItem{deviceId=0, config{1.0 ?mcc0mnc [en_DE,de_DE,ar_EG] ldltr sw434dp w964dp h434dp 450dpi nrml long layoutCompatNeeded land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 2712, 1220) mAppBounds=Rect(0, 0 - 2712, 1220) mMaxBounds=Rect(0, 0 - 2712, 1220) mDisplayRotation=ROTATION_90 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_90} as.2 s.3409 fontWeightAdjustment=0 ?spn ?gid}} tId:1538356034 ActivityRelaunchItem{mActivityToken=android.os.BinderProxy@db25a03,pendingResults=null,pendingNewIntents=null,config={mGlobalConfig={1.0 ?mcc0mnc [en_DE,de_DE,ar_EG] ldltr sw434dp w964dp h434dp 450dpi nrml long layoutCompatNeeded land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 2712, 1220) mAppBounds=Rect(0, 0 - 2712, 1220) mMaxBounds=Rect(0, 0 - 2712, 1220) mDisplayRotation=ROTATION_90 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_90} as.2 s.3409 fontWeightAdjustment=0 ?spn ?gid} mOverrideConfig={1.0 ?mcc0mnc [en_DE,de_DE,ar_EG] ldltr sw434dp w964dp h434dp 450dpi nrml long layoutCompatNeeded land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 2712, 1220) mAppBounds=Rect(0, 0 - 2712, 1220) mMaxBounds=Rect(0, 0 - 2712, 1220) mDisplayRotation=ROTATION_90 mWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_90} as.2 s.3 fontWeightAdjustment=0 ?spn ?gid}},activityWindowInfo=ActivityWindowInfo{isEmbedded=false, taskBounds=Rect(0, 0 - 2712, 1220), taskFragmentBounds=Rect(0, 0 - 2712, 1220)},configChanges=1152,preserveWindow=false} tId:1538356034 Target activity: com.nextcloud.talk.chat.ChatActivity tId:1538356034 ResumeActivityItem{mActivityToken=android.os.BinderProxy@db25a03,procState=-1,isForward=false,shouldSendCompatFakeFocus=false} tId:1538356034 Target activity: com.nextcloud.talk.chat.ChatActivity tId:1538356034 ] tId:1538356034 } 2026-01-29 09:58:13.087 3875-3875 AndroidRuntime com.nextcloud.talk2 D Shutting down VM 2026-01-29 09:58:13.090 3875-3875 AndroidRuntime com.nextcloud.talk2 E FATAL EXCEPTION: main (Fix with AI) Process: com.nextcloud.talk2, PID: 3875 kotlin.UninitializedPropertyAccessException: lateinit property binding has not been initialized at com.nextcloud.talk.chat.MessageInputFragment.getBinding(MessageInputFragment.kt:128) at com.nextcloud.talk.chat.MessageInputFragment.handleButtonsVisibility(MessageInputFragment.kt:704) at com.nextcloud.talk.chat.MessageInputFragment.updateScheduledMessagesAvailability(MessageInputFragment.kt:756) at com.nextcloud.talk.chat.ChatActivity.initObservers$lambda$6(ChatActivity.kt:979) at com.nextcloud.talk.chat.ChatActivity.$r8$lambda$_QqnoIWSyNJn8ELB500xQ0ODlUk(Unknown Source:0) at com.nextcloud.talk.chat.ChatActivity$$ExternalSyntheticLambda73.invoke(D8$$SyntheticClass:0) at com.nextcloud.talk.chat.ChatActivity$sam$androidx_lifecycle_Observer$0.onChanged(Unknown Source:2) at androidx.lifecycle.LiveData.considerNotify(LiveData.java:134) at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:147) at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:482) Signed-off-by: Marcel Hibbe <[email protected]>
1 parent 01d6300 commit 8af04aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ class MessageInputFragment : Fragment() {
697697
}
698698

699699
private fun handleButtonsVisibility() {
700+
if (!this::binding.isInitialized) {
701+
Log.w(TAG, "binding not initialized in handleButtonsVisibility")
702+
return
703+
}
704+
700705
fun View.setVisible(isVisible: Boolean) {
701706
visibility = if (isVisible) View.VISIBLE else View.GONE
702707
}

0 commit comments

Comments
 (0)