From a582b15103c4e5cfc0de4d946b70c929ecaa648a Mon Sep 17 00:00:00 2001 From: Godzil Date: Wed, 1 Aug 2018 00:50:38 +0100 Subject: [PATCH] Check if the we got proper information about the session, else die with a lot of suffers! --- src/my_request.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/my_request.ts b/src/my_request.ts index 8c9d7fd..590c5c8 100644 --- a/src/my_request.ts +++ b/src/my_request.ts @@ -51,6 +51,7 @@ function startSession(config: IConfig): Promise }) .then((response: any) => { + if ((response.data === undefined) || (response.data.session_id === undefined)) throw new Error('Getting session failed: ' + JSON.stringify(response)); return response.data.session_id; }); }