Fix bug for first time runs
Properly handles the case where a user will install the plugin without any config defined. Creating a URI with an empty string will throw an exception
This commit is contained in:
parent
e286ec4452
commit
a9fe0f5aac
1 changed files with 6 additions and 4 deletions
|
|
@ -60,7 +60,12 @@ namespace LANCommander.SDK
|
|||
|
||||
public Client(string baseUrl, string defaultInstallDirectory, ILogger logger)
|
||||
{
|
||||
BaseUrl = new Uri(baseUrl);
|
||||
if (!String.IsNullOrWhiteSpace(baseUrl))
|
||||
{
|
||||
BaseUrl = new Uri(baseUrl);
|
||||
ApiClient = new RestClient(BaseUrl);
|
||||
}
|
||||
|
||||
DefaultInstallDirectory = defaultInstallDirectory;
|
||||
|
||||
Games = new GameService(this, DefaultInstallDirectory, logger);
|
||||
|
|
@ -69,9 +74,6 @@ namespace LANCommander.SDK
|
|||
Actions = new ActionService(this);
|
||||
Profile = new ProfileService(this, logger);
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(baseUrl))
|
||||
ApiClient = new RestClient(BaseUrl);
|
||||
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue