Fix NullReferenceException when using UserName uninitialized

This commit is contained in:
Philipp Gildein 2010-06-15 15:19:14 +02:00 committed by Hylke Bons
parent 6ef284e386
commit 7686135d93

View file

@ -61,8 +61,8 @@ namespace SparkleShare {
Process.StartInfo.WorkingDirectory = LocalPath;
// Get user.name, example: "User Name"
UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName);
if (UserName.Equals (""))
UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName);
if (UnixUserInfo.RealName.Equals (""))
UserName = "Anonymous";
else
UserName = UnixUserInfo.RealName;