[X] recover from memberaccessEx

- fixes #5589
This commit is contained in:
Stephane Delcroix 2019-03-18 11:25:47 +01:00
Родитель 308c6cbddb
Коммит d106e21d5b
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -94,8 +94,8 @@ namespace Xamarin.Forms.Xaml
try {
value = Activator.CreateInstance(type);
}
catch (TargetInvocationException tie) {
value = XamlLoader.InstantiationFailedCallback?.Invoke(new XamlLoader.CallbackTypeInfo { XmlNamespace = node.XmlType.NamespaceUri, XmlTypeName = node.XmlType.Name }, type, tie) ?? throw tie;
catch (Exception e) when (e is TargetInvocationException || e is MemberAccessException) {
value = XamlLoader.InstantiationFailedCallback?.Invoke(new XamlLoader.CallbackTypeInfo { XmlNamespace = node.XmlType.NamespaceUri, XmlTypeName = node.XmlType.Name }, type, e) ?? throw e;
}
}
}