When we sideload an app, the constructor of Messaging updates the static variable MessagingHandler.messaging, which throws the IllegalStateException when its value is not null. As a result, the app crashes due to the uncaught exception.
The change introduces the following changes:
Updates the access modifier of the static MessagingHandler.messaging to private, which only updates its value through functions.
Resets the static variable MessagingHandler.messaging in the Messaging constructor.
Catches the excpetion and prints it to the console when updating the MessagingHandler.messaging throws an exception.
When we sideload an app, the constructor of Messaging updates the static variable
MessagingHandler.messaging
, which throws the IllegalStateException when its value is not null. As a result, the app crashes due to the uncaught exception.The change introduces the following changes:
MessagingHandler.messaging
to private, which only updates its value through functions.MessagingHandler.messaging
in the Messaging constructor.MessagingHandler.messaging
throws an exception.