Skip to content

Fix: Add initialization checks for bluetoothService and adapter in cl…#8

Open
Bang-ukpc wants to merge 1 commit into
diantahoc:mainfrom
UKParkingControl:fix/bluetooth-service-lateinit-crash
Open

Fix: Add initialization checks for bluetoothService and adapter in cl…#8
Bang-ukpc wants to merge 1 commit into
diantahoc:mainfrom
UKParkingControl:fix/bluetooth-service-lateinit-crash

Conversation

@Bang-ukpc
Copy link
Copy Markdown

…eanup methods

  • Fix crash when BackgroundService stops before onAttachedToActivity is called
  • Add check in onDetachedFromEngine() for bluetoothService and adapter
  • Add check in onDetachedFromActivityForConfigChanges() for bluetoothService
  • Add check in onReattachedToActivityForConfigChanges() for bluetoothService
  • Add check in onDetachedFromActivity() for bluetoothService

This prevents UninitializedPropertyAccessException when plugin cleanup happens before lateinit properties are initialized.

Fixes issue: kotlin.UninitializedPropertyAccessException: lateinit property bluetoothService has not been initialized

…eanup methods

- Fix crash when BackgroundService stops before onAttachedToActivity is called
- Add check in onDetachedFromEngine() for bluetoothService and adapter
- Add check in onDetachedFromActivityForConfigChanges() for bluetoothService
- Add check in onReattachedToActivityForConfigChanges() for bluetoothService
- Add check in onDetachedFromActivity() for bluetoothService

This prevents UninitializedPropertyAccessException when plugin cleanup
happens before lateinit properties are initialized.

Fixes issue: kotlin.UninitializedPropertyAccessException: lateinit property bluetoothService has not been initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant