Bugfix WriteLineAsync(String value) to not crash on writing null string
authorMarek Safar <marek.safar@gmail.com>
Thu, 19 Feb 2015 15:38:03 +0000 (16:38 +0100)
committerMarek Safar <marek.safar@gmail.com>
Mon, 2 May 2016 22:07:51 +0000 (00:07 +0200)
mcs/class/referencesource/mscorlib/system/io/streamwriter.cs

index 784d468a5b9709cc155d95febb19fb00c21b0558..98d76c9936288862138167f1a1f711d426fed817 100644 (file)
@@ -756,7 +756,7 @@ namespace System.IO
 
             CheckAsyncTaskInProgress();
 
-            Task task = WriteAsyncInternal(this, value, charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
+            Task task = WriteAsyncInternal(this, value ?? "", charBuffer, charPos, charLen, CoreNewLine, autoFlush, appendNewLine: true);
             _asyncWriteTask = task;
 
             return task;