Skip to content

Commit

Permalink
Let's catch the situation where the API key is a string object, but i…
Browse files Browse the repository at this point in the history
…s blank.
  • Loading branch information
jMyles committed Jan 31, 2025
1 parent 4ad88d2 commit df9fa7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/build_logic/chain_reading.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export async function fetch_chaindata(shows) {
// API key things
const apiKey = process.env.ALCHEMY_API_KEY;

if (apiKey === undefined) {
if (apiKey === undefined || apiKey === "") {
throw new Error("Not seeing API keys in .env - ask Justin or somebody for the secrets file.");
}

Expand Down
2 changes: 1 addition & 1 deletion src/build_logic/fetch_video_metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function getBlueRailroadMetadata() {
let apiKey = process.env.ALCHEMY_API_KEY;
let apiUri;
// Bail if the API key is not set.
if (apiKey) {
if (apiKey && apiKey !== "") {
apiUri = `https://opt-mainnet.g.alchemy.com/v2/${apiKey}`;
} else {
throw new Error('The API key is not set in the environment variables.');
Expand Down

0 comments on commit df9fa7d

Please sign in to comment.