From c3eb24cbb501c8f6aa465aaa32d72a1cef2381ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Tue, 25 May 2021 11:49:56 +0500 Subject: [PATCH] fix defix devision by zero exception --- AsbCloudInfrastructure/Services/DataService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AsbCloudInfrastructure/Services/DataService.cs b/AsbCloudInfrastructure/Services/DataService.cs index dbddc192..d8c92c42 100644 --- a/AsbCloudInfrastructure/Services/DataService.cs +++ b/AsbCloudInfrastructure/Services/DataService.cs @@ -54,7 +54,8 @@ namespace AsbCloudInfrastructure.Services if (fullDataCount > 1.2 * approxPointsCount) { var m = approxPointsCount / fullDataCount; - fullData = fullData.Where(d => d.Id % m == 0); + if(m > 1) + fullData = fullData.Where(d => d.Id % m == 0); } var dbData = fullData.ToList();