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()
|
||||
{
|
||||
string path = GetConfigurationFilePath();
|
||||
if (!File.Exists(path))
|
||||
TaskTriggerInfo[] list = null;
|
||||
if (File.Exists(path))
|
||||
{
|
||||
// File doesn't exist. No biggie. Return defaults.
|
||||
GetDefaultTriggers();
|
||||
list = JsonSerializer.DeserializeFromFile<TaskTriggerInfo[]>(path);
|
||||
}
|
||||
|
||||
var list = JsonSerializer.DeserializeFromFile<TaskTriggerInfo[]>(path);
|
||||
|
||||
// Return defaults if file doesn't exist.
|
||||
return list ?? GetDefaultTriggers();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user