Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 788bbd12 authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

orbotservice: check mNotifyBuilder is not null

parent 4e2e3b0f
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -143,7 +143,9 @@ public class OrbotService extends VpnService implements OrbotConstants {
    }

    private void showConnectedToTorNetworkNotification() {
        if (mNotifyBuilder != null) {
            mNotifyBuilder.setProgress(0, 0, false);
        }
        showToolbarNotification(getString(R.string.status_activated), NOTIFY_ID, R.drawable.ic_stat_tor);
    }

@@ -661,7 +663,9 @@ public class OrbotService extends VpnService implements OrbotConstants {
                return;
            }

            if (mNotifyBuilder != null) {
                mNotifyBuilder.setProgress(100, 0, false);
            }
            showToolbarNotification("", NOTIFY_ID, R.drawable.ic_stat_tor);

            startTorService();
@@ -906,7 +910,9 @@ public class OrbotService extends VpnService implements OrbotConstants {
            if (notificationMessage.contains(LOG_NOTICE_BOOTSTRAPPED)) {
                var percent = notificationMessage.substring(LOG_NOTICE_BOOTSTRAPPED.length());
                percent = percent.substring(0, percent.indexOf('%')).trim();
                if (mNotifyBuilder != null) {
                    mNotifyBuilder.setProgress(100, Integer.parseInt(percent), false);
                }
                notificationMessage = notificationMessage.substring(notificationMessage.indexOf(':') + 1).trim();
            }
        }