mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 14:46:26 +00:00
Abort example if env variables are not set
This commit is contained in:
parent
7aea4e365e
commit
1876a10b26
@ -16,6 +16,13 @@ namespace Example.CLI.CustomHTML
|
|||||||
|
|
||||||
public static async Task Main()
|
public static async Task Main()
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
|
||||||
|
{
|
||||||
|
throw new NullReferenceException(
|
||||||
|
"Please set SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET via environment variables before starting the program"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
_server = new EmbedIOAuthServer(
|
_server = new EmbedIOAuthServer(
|
||||||
new Uri("http://localhost:5000/callback"),
|
new Uri("http://localhost:5000/callback"),
|
||||||
5000,
|
5000,
|
||||||
|
Loading…
Reference in New Issue
Block a user