Fix crash when trying to deserialize a non-existing scheduled task
This commit is contained in:
parent
b4893b9ac9
commit
a05d803d4c
|
@ -528,14 +528,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
||||||
private TaskTriggerInfo[] LoadTriggerSettings()
|
private TaskTriggerInfo[] LoadTriggerSettings()
|
||||||
{
|
{
|
||||||
string path = GetConfigurationFilePath();
|
string path = GetConfigurationFilePath();
|
||||||
if (!File.Exists(path))
|
TaskTriggerInfo[] list = null;
|
||||||
|
if (File.Exists(path))
|
||||||
{
|
{
|
||||||
// File doesn't exist. No biggie. Return defaults.
|
list = JsonSerializer.DeserializeFromFile<TaskTriggerInfo[]>(path);
|
||||||
GetDefaultTriggers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = JsonSerializer.DeserializeFromFile<TaskTriggerInfo[]>(path);
|
// Return defaults if file doesn't exist.
|
||||||
|
|
||||||
return list ?? GetDefaultTriggers();
|
return list ?? GetDefaultTriggers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user