Skip to content

Commit 8490200

Browse files
authored
Merge pull request #7 from Avametix/fix/logout
2 parents 3b877dd + 19b9820 commit 8490200

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Avametix/DirectApi.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ public function login_as(string $username) {
6767
* @access public
6868
*/
6969
public function logout() {
70-
$this->usernames = array_splice($this->usernames, 0, 1);
70+
if (count($this->usernames) < 2)
71+
return;
72+
73+
array_splice($this->usernames, 1, 1);
7174
}
7275

7376
/**

0 commit comments

Comments
 (0)