mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
Prevent a NRE while looking for git location
This commit is contained in:
parent
25de0f9112
commit
9e9bb0eba1
@ -12,9 +12,14 @@ namespace UpdateAssemblyInfo
|
||||
if (File.Exists(p))
|
||||
return p;
|
||||
|
||||
p = Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles(x86)"), @"Git\bin\git.exe");
|
||||
// This variable doesn't get set on every Windows configuration. (@alfaproject vm for example)
|
||||
var programFiles = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
|
||||
if (programFiles != null)
|
||||
{
|
||||
p = Path.Combine(programFiles, @"Git\bin\git.exe");
|
||||
if (File.Exists(p))
|
||||
return p;
|
||||
}
|
||||
|
||||
p = @"C:\Program Files\Git\bin\git.exe";
|
||||
if (File.Exists(p))
|
||||
|
Loading…
Reference in New Issue
Block a user