Fixed some bug with null thread handler in XMPPConnectionService.

This commit is contained in:
ChronosX88 2019-05-23 16:41:52 +04:00
parent 398adfeece
commit 0fefada982

View File

@ -70,6 +70,7 @@ public class XMPPConnectionService extends Service {
private void onServiceStop() { private void onServiceStop() {
isThreadAlive = false; isThreadAlive = false;
if(threadHandler != null) {
threadHandler.post(() -> { threadHandler.post(() -> {
if(connection != null) { if(connection != null) {
thread.interrupt(); thread.interrupt();
@ -79,6 +80,7 @@ public class XMPPConnectionService extends Service {
} }
}); });
} }
}
private void createConnection() { private void createConnection() {
if(connection == null) { if(connection == null) {