Skip to content

Commit 8067544

Browse files
authored
Merge pull request #24 from CandyCoded/hotfix/fixed-possible-null
[hotfix] Fixed possible null warning.
2 parents 5fe21ea + 659d22e commit 8067544

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static void DiscardChanges(string path)
140140
CreateNoWindow = true
141141
});
142142
143-
if (process.StandardError.ReadLine().StartsWith("error: pathspec"))
143+
if (process?.StandardError.ReadLine() is string line && line.StartsWith("error: pathspec"))
144144
{
145145

146146
Debug.LogError("File not tracked by git.");

0 commit comments

Comments
 (0)