mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-06-25 19:42:36 +00:00
Fix PHP invalid index warning
This commit is contained in:
parent
1021eb3ab1
commit
77d5f8da20
|
@ -3880,7 +3880,11 @@ class Net_SSH2
|
|||
*/
|
||||
function getLastError()
|
||||
{
|
||||
return $this->errors[count($this->errors) - 1];
|
||||
$count = count($this->errors);
|
||||
|
||||
if ($count > 0) {
|
||||
return $this->errors[$count - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user