diff --git a/package/src/lib/octokit.ts b/package/src/lib/octokit.ts index 82e4962..1dc0439 100644 --- a/package/src/lib/octokit.ts +++ b/package/src/lib/octokit.ts @@ -99,11 +99,9 @@ export const getGistFile = async ( filename: string ) => { const gist = await gistGrabber(gistId); - if (gist?.files){ - const file = gist.files[filename]; - return file - } - return null; + if (gist === null) return null; + if (!gist.files) return null; + return gist.files[filename]; }; // Get a Group of Gist files by ID