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 3d009eba98
commit 3f3d26cb8f

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;