From 31bd12781f2e3b241f2743c1d7663270a2b799e0 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 16 Aug 2019 01:08:21 -0400 Subject: [PATCH] Return empty array instead of NULL on error (to appease ppl who can't be bothered to check) --- .../ObjectModels/FileSystem/File.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/FileSystem/File.cs b/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/FileSystem/File.cs index 96113cec..00f1ca02 100644 --- a/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/FileSystem/File.cs +++ b/CSharp/Libraries/UniversalEditor.Essential/ObjectModels/FileSystem/File.cs @@ -125,14 +125,15 @@ namespace UniversalEditor.ObjectModels.FileSystem } Console.WriteLine("DataRequest: " + mvarName + ": No source associated with this file"); - return null; + return new byte[0]; } + public byte[] GetData(long offset, long length) { if (mvarSource != null) return mvarSource.GetData(offset, length); Console.WriteLine("DataRequest: " + mvarName + ": No source associated with this file"); - return null; + return new byte[length]; } private System.IO.Stream mvarStream = null;