From 73604294c205b6853dedc605497e50fac041ca14 Mon Sep 17 00:00:00 2001 From: David McIntosh <804610+mctofu@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:49:30 +0000 Subject: [PATCH] More idomatic existence check Co-authored-by: AbdulFattaah Popoola --- src/api-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index 21a99b5..5882bb1 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -56,7 +56,7 @@ export class ApiClient { }: ${JSON.stringify(res.result)}` ) } - if (res.result == null) { + if (!res.result) { throw new JobDetailsFetchingError( `fetching job details: missing response` ) @@ -94,7 +94,7 @@ export class ApiClient { }: ${JSON.stringify(res.result)}` ) } - if (res.result == null) { + if (!res.result) { throw new CredentialFetchingError( `fetching credentials: missing response` )