diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index 2b42f9dff..31a7ddd31 100755 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -355,6 +355,10 @@ class Directory extends FileAbstract implements DirectoryInterface */ public function getOwner() : string { + if ($this->con === null) { + return ''; + } + $this->owner = self::parseRawList($this->con, self::parent($this->path))[$this->path]['user']; return $this->owner; @@ -425,6 +429,10 @@ class Directory extends FileAbstract implements DirectoryInterface */ public function getPermission() : int { + if ($this->con === null) { + return 0; + } + $this->permission = self::parseRawList($this->con, self::parent($this->path))[$this->path]['permission']; return $this->permission; diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index b9625e165..1cbbffab4 100755 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -302,6 +302,10 @@ class File extends FileAbstract implements FileInterface */ public function getOwner() : string { + if ($this->con === null) { + return ''; + } + $this->owner = Directory::parseRawList($this->con, self::dirpath($this->path))[$this->path]['user']; return $this->owner; @@ -324,6 +328,10 @@ class File extends FileAbstract implements FileInterface */ public function getPermission() : int { + if ($this->con === null) { + return 0; + } + $this->permission = Directory::parseRawList($this->con, self::dirpath($this->path))[$this->path]['permission']; return $this->permission;