mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 20:08:59 +02:00
Null pointer check added for subscription as 2nd param is false.
This commit is contained in:
parent
862bcdba67
commit
6d6793151a
1 changed files with 17 additions and 9 deletions
|
@ -31,18 +31,26 @@ namespace Emby.Dlna.Eventing
|
||||||
public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl)
|
public EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl)
|
||||||
{
|
{
|
||||||
var subscription = GetSubscription(subscriptionId, false);
|
var subscription = GetSubscription(subscriptionId, false);
|
||||||
|
if (subscription != null)
|
||||||
|
{
|
||||||
|
subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300;
|
||||||
|
int timeoutSeconds = subscription.TimeoutSeconds;
|
||||||
|
subscription.SubscriptionTime = DateTime.UtcNow;
|
||||||
|
|
||||||
subscription.TimeoutSeconds = ParseTimeout(requestedTimeoutString) ?? 300;
|
_logger.LogDebug(
|
||||||
int timeoutSeconds = subscription.TimeoutSeconds;
|
"Renewing event subscription for {0} with timeout of {1} to {2}",
|
||||||
subscription.SubscriptionTime = DateTime.UtcNow;
|
subscription.NotificationType,
|
||||||
|
timeoutSeconds,
|
||||||
|
subscription.CallbackUrl);
|
||||||
|
|
||||||
_logger.LogDebug(
|
return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, timeoutSeconds);
|
||||||
"Renewing event subscription for {0} with timeout of {1} to {2}",
|
}
|
||||||
subscription.NotificationType,
|
|
||||||
timeoutSeconds,
|
|
||||||
subscription.CallbackUrl);
|
|
||||||
|
|
||||||
return GetEventSubscriptionResponse(subscriptionId, requestedTimeoutString, timeoutSeconds);
|
return new EventSubscriptionResponse
|
||||||
|
{
|
||||||
|
Content = string.Empty,
|
||||||
|
ContentType = "text/plain"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl)
|
public EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl)
|
||||||
|
|
Loading…
Reference in a new issue