From 93cdf2968f3acaa9201ce24a3c3ae5a98069b2f1 Mon Sep 17 00:00:00 2001 From: Vladimir Stroganov Date: Fri, 12 Jul 2024 16:48:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D0=BD=D0=B0?= =?UTF-8?q?=20null=20=D0=B2=20CreateViews?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/ViewPlanCreationService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RevitApartmentPlans/Services/ViewPlanCreationService.cs b/src/RevitApartmentPlans/Services/ViewPlanCreationService.cs index 2cdf574f3..c61ab43eb 100644 --- a/src/RevitApartmentPlans/Services/ViewPlanCreationService.cs +++ b/src/RevitApartmentPlans/Services/ViewPlanCreationService.cs @@ -41,8 +41,11 @@ public ICollection CreateViews( var i = 0; foreach(var apartment in apartments) { ct.ThrowIfCancellationRequested(); - views.AddRange(CreateViews(apartment, templates, feetOffset)); - progress.Report(++i); + var createdViews = CreateViews(apartment, templates, feetOffset); + if(createdViews.Count > 0) { + views.AddRange(createdViews); + } + progress?.Report(++i); } t.Commit(); }