mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Fix crash when trying to deserialize a non-existing scheduled task
This commit is contained in:
parent
b4893b9ac9
commit
a05d803d4c
1 changed files with 4 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue