fixes of obvious code mistakes#1071
Conversation
|
Hi @DamirAinullin, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
| (Path.IsPathRooted(ScriptPath) || Path.IsPathRooted(WorkingDirectory)) && | ||
| File.Exists(Path.Combine(WorkingDirectory, ScriptPath)) && | ||
| (string.IsNullOrEmpty(WorkingDirectory) || Directory.Exists(WorkingDirectory)) && | ||
| (WorkingDirectory == string.Empty || Directory.Exists(WorkingDirectory)) && |
There was a problem hiding this comment.
This changes the behavior and some analyzers will complain about comparing to string.Empty directly. Is there a specific reason for this change?
There was a problem hiding this comment.
We use WorkingDirectory at the line 152, before check it for null. So I can suppose that check is not needed. Maybe NullReferenceException is possible at the line 152. Maybe we should check it for null before using.
|
Thanks for the fixes. Just one small comment to take a look at before we merge this in. What tool did you use to find these? |
|
Thanks for positive response. I just try to help your project. I use static analyser PVS-Studio. It is a wonderful tool. |
|
Thanks for details and thanks again for finding these. LGTM, merging this in now. |
fixes of some simple obvious code mistakes and warnings.