Skip to content

Commit c78c793

Browse files
logout function $this->stream is null
1 parent c9271a8 commit c78c793

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Connection/Protocols/ImapProtocol.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,16 @@ public function authenticate(string $user, string $token): bool {
467467
* @throws RuntimeException
468468
*/
469469
public function logout(): array {
470-
if (!$this->stream) {
471-
throw new RuntimeException('not connected');
470+
$result = [];
471+
if ($this->stream) {
472+
try {
473+
$result = $this->requestAndResponse('LOGOUT', [], true);
474+
} catch (Exception $e) {}
475+
fclose($this->stream);
476+
$this->stream = null;
477+
$this->uid_cache = null;
472478
}
473479

474-
$result = $this->requestAndResponse('LOGOUT', [], true);
475-
476-
fclose($this->stream);
477-
$this->stream = null;
478-
$this->uid_cache = null;
479-
480480
return $result;
481481
}
482482

0 commit comments

Comments
 (0)