From 23c7972f0dc78b0fc022cea58a7a34664e0c1dee Mon Sep 17 00:00:00 2001 From: alcexhim Date: Sat, 5 Jul 2014 19:12:28 -0400 Subject: [PATCH] Do not crash if a null filename is given --- CSharp/Libraries/UniversalEditor.Core/DataFormat.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs b/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs index 99ad104b..64df7b16 100644 --- a/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs +++ b/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs @@ -278,10 +278,8 @@ namespace UniversalEditor } public bool MatchesFile(string FileName, System.IO.Stream FileData) { - if (FileName != null) - { - FileName = System.IO.Path.GetFileName(FileName); - } + if (FileName == null) return false; + if (System.IO.File.Exists(FileName)) FileName = System.IO.Path.GetFileName(FileName); switch (mvarHintComparison) {