From 821a0ec0d217c3763d4d3e8bfeef457fc8973252 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 1 Jul 2019 15:45:20 -0500 Subject: [PATCH] simplify prop value extraction --- .../Infrastructure/Repositories/UrlsRepository.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FilterLists.Agent/Infrastructure/Repositories/UrlsRepository.cs b/src/FilterLists.Agent/Infrastructure/Repositories/UrlsRepository.cs index 1abb23e1e..c54ea11a0 100644 --- a/src/FilterLists.Agent/Infrastructure/Repositories/UrlsRepository.cs +++ b/src/FilterLists.Agent/Infrastructure/Repositories/UrlsRepository.cs @@ -24,8 +24,8 @@ public async Task> GetAllAsync() var request = new RestRequest(endpoint); var response = await _apiClient.ExecuteAsync>(request); return response.SelectMany(r => - r.GetType().GetProperties().Where(p => p.GetType() == typeof(Uri)).Select(p => (Uri)p.GetValue(r))) - .Where(u => u != null); + r.GetType().GetProperties().Where(p => p.GetType() == typeof(Uri) && p.GetValue(r) != null) + .Select(p => (Uri)p.GetValue(r))); } private static string BuildEndpoint()