From 0c4c113b0a1d3e5e09c0c1079f685272f8195478 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 4 Jun 2020 14:09:42 +0300 Subject: [PATCH] Fix account shpw command when PLATFORMIO_AUTH_TOKEN is used --- platformio/clients/account.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platformio/clients/account.py b/platformio/clients/account.py index 084110da..545595c1 100644 --- a/platformio/clients/account.py +++ b/platformio/clients/account.py @@ -167,15 +167,13 @@ class AccountClient(RESTClient): # pylint:disable=too-many-public-methods return response def get_account_info(self, offline=False): - account = app.get_state_item("account") - if not account: - raise AccountNotAuthorized() + account = app.get_state_item("account") or {} if ( account.get("summary") and account["summary"].get("expire_at", 0) > time.time() ): return account["summary"] - if offline: + if offline and account.get("email"): return { "profile": { "email": account.get("email"),