Skip to content

Commit 9496d18

Browse files
committed
Updating fix for #787
1 parent c93763a commit 9496d18

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/WebJobs.Script/Binding/FunctionBinding.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ internal static async Task BindStreamAsync(BindingContext context, FileAccess ac
213213
else
214214
{
215215
// Read the value into the context Value converting based on data type
216-
object converted = context.Value ?? new MemoryStream();
216+
object converted = context.Value;
217217
ConvertStreamToValue(stream, context.DataType, ref converted);
218218
context.Value = converted;
219219
}
@@ -287,8 +287,11 @@ public static void ConvertStreamToValue(Stream stream, DataType dataType, ref ob
287287
case DataType.Stream:
288288
// when the target value is a Stream, we copy the value
289289
// into the Stream passed in
290-
Stream targetStream = converted as Stream;
291-
stream.CopyTo(targetStream);
290+
if (converted != null)
291+
{
292+
Stream targetStream = converted as Stream;
293+
stream.CopyTo(targetStream);
294+
}
292295
break;
293296
}
294297
}

0 commit comments

Comments
 (0)