浏览代码

Fixes configuration unit test fails.

BDisp 2 年之前
父节点
当前提交
e66c3a0352
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Terminal.Gui/Configuration/Scope.cs

+ 5 - 1
Terminal.Gui/Configuration/Scope.cs

@@ -131,7 +131,11 @@ namespace Terminal.Gui.Configuration {
 							var readHelper = Activator.CreateInstance ((Type?)typeof (ReadHelper<>).MakeGenericType (typeof (scopeT), propertyType!)!, converter) as ReadHelper;
 							scope! [propertyName].PropertyValue = readHelper?.Read (ref reader, propertyType!, options);
 						} else {
-							scope! [propertyName].PropertyValue = JsonSerializer.Deserialize (ref reader, propertyType!, options);
+							try {
+								scope! [propertyName].PropertyValue = JsonSerializer.Deserialize (ref reader, propertyType!, options);
+							} catch (Exception ex) {
+								System.Diagnostics.Debug.WriteLine ($"scopeT Read: {ex}");
+							}
 						}
 					} else {
 						// It is not a config property. Maybe it's just a property on the Scope with [JsonInclude]