Skip to content

Commit 1876a10

Browse files
author
Jonas Dellinger
committed
Abort example if env variables are not set
1 parent 7aea4e3 commit 1876a10

File tree

1 file changed

+7
-0
lines changed
  • SpotifyAPI.Web.Examples/Example.CLI.CustomHTML

1 file changed

+7
-0
lines changed

SpotifyAPI.Web.Examples/Example.CLI.CustomHTML/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ public class Program
1616

1717
public static async Task Main()
1818
{
19+
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
20+
{
21+
throw new NullReferenceException(
22+
"Please set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET via environment variables before starting the program"
23+
);
24+
}
25+
1926
_server = new EmbedIOAuthServer(
2027
new Uri("http://localhost:5000/callback"),
2128
5000,

0 commit comments

Comments
 (0)