From 64d893d0cbbf292f65ed3388867441a5d1f2bd63 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Wed, 4 Jan 2017 15:14:08 -0800 Subject: [PATCH] make roaming visual studio profile option persister handle bool? data type --- .../Options/RoamingVisualStudioProfileOptionPersister.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/VisualStudio/Core/Def/Implementation/Options/RoamingVisualStudioProfileOptionPersister.cs b/src/VisualStudio/Core/Def/Implementation/Options/RoamingVisualStudioProfileOptionPersister.cs index 475b36ab5c7..09026c06faa 100644 --- a/src/VisualStudio/Core/Def/Implementation/Options/RoamingVisualStudioProfileOptionPersister.cs +++ b/src/VisualStudio/Core/Def/Implementation/Options/RoamingVisualStudioProfileOptionPersister.cs @@ -174,6 +174,11 @@ public bool TryFetch(OptionKey optionKey, out object value) value = longValue != 0; return true; } + else if (optionKey.Option.Type == typeof(bool?)) + { + // when nullable type is assigned to object, it can lose nullable type. + return (value is bool) || (value == null); + } else if (value != null && optionKey.Option.Type != value.GetType()) { // We got something back different than we expected, so fail to deserialize -- GitLab