Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Await Future in method "disconnect" #96

Open
YukiAttano opened this issue Feb 1, 2024 · 1 comment
Open

Await Future in method "disconnect" #96

YukiAttano opened this issue Feb 1, 2024 · 1 comment

Comments

@YukiAttano
Copy link

The invokeMethod("disconnect") call is not awaited. Which seems to throw if no connection is running and the method gets called.
This Exception can't be catched because disconnect() does not await the invokeMethod() call.

  ///Disconnect from VPN
  void disconnect() {
    _tempDateTime = null;
    _channelControl.invokeMethod("disconnect");
    if (_vpnStatusTimer?.isActive ?? false) {
      _vpnStatusTimer?.cancel();
      _vpnStatusTimer = null;
    }
  }
@bugrevealingbme
Copy link

I'm getting sometime:

E/flutter ( 5968): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void de.blinkt.openvpn.core.OpenVPNService.openvpnStopped()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'void de.blinkt.openvpn.core.OpenVPNService.openvpnStopped()' on a null object reference

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

No branches or pull requests

2 participants