Fix NullReferenceException when using UserName uninitialized
This commit is contained in:
parent
6ef284e386
commit
7686135d93
|
@ -62,7 +62,7 @@ namespace SparkleShare {
|
|||
|
||||
// Get user.name, example: "User Name"
|
||||
UnixUserInfo UnixUserInfo = new UnixUserInfo (UnixEnvironment.UserName);
|
||||
if (UserName.Equals (""))
|
||||
if (UnixUserInfo.RealName.Equals (""))
|
||||
UserName = "Anonymous";
|
||||
else
|
||||
UserName = UnixUserInfo.RealName;
|
||||
|
|
Loading…
Reference in a new issue