From c2197ecf7cee3aa234de6337ce879ff816a8c23e Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 6 Nov 2024 00:18:29 +1100 Subject: [PATCH] Fix resume for files being sent, and dont throw exception if we cannot open a file to send --- app/Classes/File/File.php | 2 +- app/Classes/File/Send.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Classes/File/File.php b/app/Classes/File/File.php index 20cc0c9..57ca726 100644 --- a/app/Classes/File/File.php +++ b/app/Classes/File/File.php @@ -108,6 +108,6 @@ final class File extends Send public function seek(int $pos): bool { - return (fseek($this->f,$pos,SEEK_SET) === 0); + return (fseek($this->fd,$pos,SEEK_SET) === 0); } } \ No newline at end of file diff --git a/app/Classes/File/Send.php b/app/Classes/File/Send.php index 2652dad..8a8b608 100644 --- a/app/Classes/File/Send.php +++ b/app/Classes/File/Send.php @@ -245,7 +245,10 @@ class Send extends Base return TRUE; } else { - throw new Exception('No files to open'); + Log::error(sprintf('%s:- No files to open',self::LOGKEY)); + $this->index = NULL; + + return FALSE; } }