Fix PHP invalid index warning

This commit is contained in:
splitice 2015-11-20 07:11:43 +11:00 committed by Andreas Fischer
parent 1021eb3ab1
commit 77d5f8da20

View File

@ -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];
}
}
/**