diff --git a/src/PhpseclibV3/SimpleConnectivityChecker.php b/src/PhpseclibV3/SimpleConnectivityChecker.php index 2e198f2ec..fddcdb566 100644 --- a/src/PhpseclibV3/SimpleConnectivityChecker.php +++ b/src/PhpseclibV3/SimpleConnectivityChecker.php @@ -5,11 +5,16 @@ namespace League\Flysystem\PhpseclibV3; use phpseclib3\Net\SFTP; +use Throwable; class SimpleConnectivityChecker implements ConnectivityChecker { public function isConnected(SFTP $connection): bool { - return $connection->isConnected(); + try { + return $connection->ping(); + } catch (Throwable) { + return false; + } } }