Skip to content

Commit 946e04f

Browse files
committed
Check stream before writing file.
1 parent 763fc94 commit 946e04f

File tree

1 file changed

+7
-2
lines changed
  • Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor

1 file changed

+7
-2
lines changed

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/GitIgnore.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ public static async Task Create(string directory)
3636
using (var stream = response.GetResponseStream())
3737
{
3838

39-
await stream.CopyToAsync(content);
39+
if (stream != null)
40+
{
4041

41-
File.WriteAllBytes(path, content.ToArray());
42+
await stream.CopyToAsync(content);
43+
44+
File.WriteAllBytes(path, content.ToArray());
45+
46+
}
4247

4348
}
4449

0 commit comments

Comments
 (0)