Fixed: (Apps) Prevent null reference exception on sync failure

pull/1712/head
Bogdan 2 years ago
parent 9fd3eb4d6b
commit e40ccc49ad

@ -78,6 +78,14 @@ namespace NzbDrone.Core.Applications.LazyLibrarian
var lazyLibrarianIndexer = BuildLazyLibrarianIndexer(indexer, indexer.Protocol); var lazyLibrarianIndexer = BuildLazyLibrarianIndexer(indexer, indexer.Protocol);
var remoteIndexer = _lazyLibrarianV1Proxy.AddIndexer(lazyLibrarianIndexer, Settings); var remoteIndexer = _lazyLibrarianV1Proxy.AddIndexer(lazyLibrarianIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" });
} }

@ -95,6 +95,14 @@ namespace NzbDrone.Core.Applications.Lidarr
var lidarrIndexer = BuildLidarrIndexer(indexer, indexer.Protocol); var lidarrIndexer = BuildLidarrIndexer(indexer, indexer.Protocol);
var remoteIndexer = _lidarrV1Proxy.AddIndexer(lidarrIndexer, Settings); var remoteIndexer = _lidarrV1Proxy.AddIndexer(lidarrIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id });
} }

@ -78,6 +78,14 @@ namespace NzbDrone.Core.Applications.Mylar
var mylarIndexer = BuildMylarIndexer(indexer, indexer.Protocol); var mylarIndexer = BuildMylarIndexer(indexer, indexer.Protocol);
var remoteIndexer = _mylarV3Proxy.AddIndexer(mylarIndexer, Settings); var remoteIndexer = _mylarV3Proxy.AddIndexer(mylarIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerName = $"{remoteIndexer.Type},{remoteIndexer.Name}" });
} }

@ -95,6 +95,14 @@ namespace NzbDrone.Core.Applications.Radarr
var radarrIndexer = BuildRadarrIndexer(indexer, indexer.Protocol); var radarrIndexer = BuildRadarrIndexer(indexer, indexer.Protocol);
var remoteIndexer = _radarrV3Proxy.AddIndexer(radarrIndexer, Settings); var remoteIndexer = _radarrV3Proxy.AddIndexer(radarrIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id });
} }

@ -96,6 +96,14 @@ namespace NzbDrone.Core.Applications.Readarr
var readarrIndexer = BuildReadarrIndexer(indexer, indexer.Protocol); var readarrIndexer = BuildReadarrIndexer(indexer, indexer.Protocol);
var remoteIndexer = _readarrV1Proxy.AddIndexer(readarrIndexer, Settings); var remoteIndexer = _readarrV1Proxy.AddIndexer(readarrIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id });
} }

@ -96,6 +96,14 @@ namespace NzbDrone.Core.Applications.Sonarr
var sonarrIndexer = BuildSonarrIndexer(indexer, indexer.Protocol); var sonarrIndexer = BuildSonarrIndexer(indexer, indexer.Protocol);
var remoteIndexer = _sonarrV3Proxy.AddIndexer(sonarrIndexer, Settings); var remoteIndexer = _sonarrV3Proxy.AddIndexer(sonarrIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id });
} }

@ -96,6 +96,14 @@ namespace NzbDrone.Core.Applications.Whisparr
var whisparrIndexer = BuildWhisparrIndexer(indexer, indexer.Protocol); var whisparrIndexer = BuildWhisparrIndexer(indexer, indexer.Protocol);
var remoteIndexer = _whisparrV3Proxy.AddIndexer(whisparrIndexer, Settings); var remoteIndexer = _whisparrV3Proxy.AddIndexer(whisparrIndexer, Settings);
if (remoteIndexer == null)
{
_logger.Debug("Failed to add {0} [{1}]", indexer.Name, indexer.Id);
return;
}
_appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id }); _appIndexerMapService.Insert(new AppIndexerMap { AppId = Definition.Id, IndexerId = indexer.Id, RemoteIndexerId = remoteIndexer.Id });
} }

Loading…
Cancel
Save