Skip to content

Commit 1073df7

Browse files
authored
Update Program.cs
1 parent b1f2a1f commit 1073df7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ static class Program
380380
[STAThread]
381381
static void Main()
382382
{
383-
// Create application mutex to prevent multiple instances
384383
const string mutexName = "Global\\SpotifyPreventLock";
385384
_mutex = new Mutex(true, mutexName, out bool isFirstInstance);
386385

@@ -433,8 +432,9 @@ private static bool CheckForVersionConflicts()
433432
string? processPath = process.MainModule?.FileName;
434433
if (string.IsNullOrEmpty(processPath)) continue;
435434

436-
var runningVersion = FileVersionInfo.GetVersionInfo(processPath).FileVersion != null
437-
? new Version(FileVersionInfo.GetVersionInfo(processPath).FileVersion)
435+
var fileVersionInfo = FileVersionInfo.GetVersionInfo(processPath);
436+
var runningVersion = !string.IsNullOrEmpty(fileVersionInfo.FileVersion)
437+
? new Version(fileVersionInfo.FileVersion)
438438
: new Version(1, 0, 0);
439439

440440
int versionComparison = runningVersion.CompareTo(currentVersion);

0 commit comments

Comments
 (0)