diff --git a/src/DynamoCore/Logging/AnalyticsService.cs b/src/DynamoCore/Logging/AnalyticsService.cs index 037c1f00ae1..5ed073b98c5 100644 --- a/src/DynamoCore/Logging/AnalyticsService.cs +++ b/src/DynamoCore/Logging/AnalyticsService.cs @@ -84,6 +84,12 @@ internal static bool IsADPOptedIn internal static bool IsADPAvailable() { + if (Analytics.DisableAnalytics || + adpAnalyticsUI == null) + { + return false; + } + return adpAnalyticsUI.IsProviderAvailable(); } diff --git a/src/DynamoCore/Models/DynamoModel.cs b/src/DynamoCore/Models/DynamoModel.cs index 4916fa7082a..038e5883cc5 100644 --- a/src/DynamoCore/Models/DynamoModel.cs +++ b/src/DynamoCore/Models/DynamoModel.cs @@ -983,6 +983,9 @@ private void CheckFeatureFlagTest() { if (!DynamoModel.IsTestMode) { + if (DynamoModel.FeatureFlags == null) + return; + if (DynamoModel.FeatureFlags.CheckFeatureFlag("EasterEggIcon1", false)) { this.Logger.Log("EasterEggIcon1 is true FROM MODEL"); diff --git a/src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs b/src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs index da57ec951bf..5acce1fc58d 100644 --- a/src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs +++ b/src/DynamoCore/Scheduler/UpdateRenderPackageAsyncTask.cs @@ -230,7 +230,7 @@ private void GetTessellationDataFromGraphicItem(Guid outputPortId, IGraphicItem var previousMeshVertexCount = package.MeshVertexCount; //Todo Plane tessellation needs to be handled here vs in LibG currently - bool instancingEnabled = DynamoModel.FeatureFlags.CheckFeatureFlag("graphics-primitive-instancing", false); + bool instancingEnabled = DynamoModel.FeatureFlags?.CheckFeatureFlag("graphics-primitive-instancing", false) ?? false; if (graphicItem is Plane plane) { CreatePlaneTessellation(package, plane); diff --git a/src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs b/src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs index e0d653e44c8..136d345db1b 100644 --- a/src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs @@ -1787,7 +1787,7 @@ internal virtual void AggregateRenderPackages(IEnumerable pa //If we have any line geometry that was not associated with an instance, //remove the previously added line data from the render package so the remaining lines can be added to the scene. if (rp.LineVertexRangesAssociatedWithInstancing.Any() - && DynamoModel.FeatureFlags.CheckFeatureFlag("graphics-primitive-instancing", false)) + && DynamoModel.FeatureFlags?.CheckFeatureFlag("graphics-primitive-instancing", false) == true) { //For each range of line vertices add the line data and instances to the scene var j = 0; @@ -1880,7 +1880,7 @@ internal virtual void AggregateRenderPackages(IEnumerable pa //If we have any mesh geometry that was not associated with an instance, remove the previously added //mesh data from the render package so the remaining mesh can be added to the scene. if (rp.MeshVertexRangesAssociatedWithInstancing.Any() - && DynamoModel.FeatureFlags.CheckFeatureFlag("graphics-primitive-instancing", false)) + && DynamoModel.FeatureFlags?.CheckFeatureFlag("graphics-primitive-instancing", false) == true) { //For each range of mesh vertices add the mesh data and instances to the scene var j = 0; diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index ec2ded6d658..dbf386c6c0c 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -1067,6 +1067,9 @@ private void CheckTestFlags() { if (!DynamoModel.IsTestMode) { + if (DynamoModel.FeatureFlags == null) + return; + //feature flag test. if (DynamoModel.FeatureFlags?.CheckFeatureFlag("EasterEggIcon1", false) == true) {