From c490774627347f11091daaacff6dd5bad7d6d93f Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Wed, 15 Jun 2016 01:09:24 -0400 Subject: [PATCH] Be more specific in the types of exceptions that cause a load to fail, and break when we get a successful load --- .../UniversalEditor.Essential/Common/Reflection.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.Essential/Common/Reflection.cs b/CSharp/Libraries/UniversalEditor.Essential/Common/Reflection.cs index 9d967559..4c6e1702 100644 --- a/CSharp/Libraries/UniversalEditor.Essential/Common/Reflection.cs +++ b/CSharp/Libraries/UniversalEditor.Essential/Common/Reflection.cs @@ -301,10 +301,16 @@ namespace UniversalEditor.Common { DataFormat df = dfr.Create(); Document.Load(om, df, accessor); + break; } - catch + catch (InvalidDataFormatException ex) { - accessor.Close(); + accessor.Close (); + continue; + } + catch (NotImplementedException ex) + { + accessor.Close (); continue; } }