mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-03 12:23:27 +02:00
Fix runtime errors
This commit is contained in:
parent
635d67d458
commit
8ee1525894
|
@ -310,7 +310,9 @@ namespace Emby.Server.Implementations
|
||||||
{
|
{
|
||||||
_creatingInstances.Add(type);
|
_creatingInstances.Add(type);
|
||||||
Logger.LogDebug("Creating instance of {Type}", type);
|
Logger.LogDebug("Creating instance of {Type}", type);
|
||||||
return ActivatorUtilities.CreateInstance(ServiceProvider, type);
|
return ServiceProvider is null
|
||||||
|
? Activator.CreateInstance(type)
|
||||||
|
: ActivatorUtilities.CreateInstance(ServiceProvider, type);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
using System.Text.Json.Serialization.Metadata;
|
||||||
using Jellyfin.Extensions.Json.Converters;
|
using Jellyfin.Extensions.Json.Converters;
|
||||||
|
|
||||||
namespace Jellyfin.Extensions.Json
|
namespace Jellyfin.Extensions.Json
|
||||||
|
@ -41,7 +42,8 @@ namespace Jellyfin.Extensions.Json
|
||||||
new JsonNullableStructConverterFactory(),
|
new JsonNullableStructConverterFactory(),
|
||||||
new JsonDateTimeConverter(),
|
new JsonDateTimeConverter(),
|
||||||
new JsonStringConverter()
|
new JsonStringConverter()
|
||||||
}
|
},
|
||||||
|
TypeInfoResolver = new DefaultJsonTypeInfoResolver()
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new(_jsonSerializerOptions)
|
private static readonly JsonSerializerOptions _pascalCaseJsonSerializerOptions = new(_jsonSerializerOptions)
|
||||||
|
|
Loading…
Reference in a new issue