flutter_ssh icon indicating copy to clipboard operation
flutter_ssh copied to clipboard

got `java.lang.NullPointerException` on android, `Unhandled Exception: PlatformException(ls_failure, Failed to list path /, null, null)` on ios

Open carlhung opened this issue 4 years ago • 0 comments

after connecting: client.connect(); client.connectSFTP(); when loading the directory by calling: widget.client.sftpLs("/")

it crashes:

on android i got this: D/SshPlugin(10981): Session connected I/flutter (10981): connect result: session_connected E/AndroidRuntime(10981): FATAL EXCEPTION: Thread-5 E/AndroidRuntime(10981): Process: com.example.online_disk, PID: 10981 E/AndroidRuntime(10981): java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Vector com.jcraft.jsch.ChannelSftp.ls(java.lang.String)' on a null object reference E/AndroidRuntime(10981): at sq.flutter.ssh.SshPlugin$8.run(SshPlugin.java:433) E/AndroidRuntime(10981): at java.lang.Thread.run(Thread.java:923) Lost connection to device.

on ios i got this: flutter: connect result: session_connected [VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: PlatformException(ls_failure, Failed to list path /, null, null) #0 StandardMethodCodec.decodeEnvelope package:flutter/…/services/message_codecs.dart:582 #1 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:159 #2 SSHClient.sftpLs package:ssh/ssh.dart:126 #3 DiskWidgetExtension.createScaffold. (package:online_disk/View/Disk/DiskWidgetExtension.dart) package:online_disk/…/Disk/DiskWidgetExtension.dart:1

carlhung avatar Nov 30 '20 01:11 carlhung