final fix

This commit is contained in:
Mark van der Wal 2020-04-08 12:20:13 +02:00
parent cb892e9192
commit 81218ec0d0

View File

@ -59,13 +59,12 @@ namespace FarmmapsApi.Services
{
List<Item> items = await _farmmapsApiService.GetItemChildrenAsync(zipItem.Code,
SHAPE_PROCESSED_ITEMTYPE);
items = items.Where(i => i.Created >= startUpload).OrderByDescending(i => i.Created).ToList();
if (items.Count(i => i.Created >= startUpload) > 0)
if (items.Any())
{
shapeItem = items.Where(i => i.Name.Contains(itemName))
.OrderByDescending(i => i.Created)
.First();
shapeItem = items.First(i => i.Name.Contains(itemName));
if(shapeItem != null)
{
source.Cancel();