Permalink
Browse files

linux: Fix crash when we can't get the username. Closes #1472

  • Loading branch information...
1 parent 6400ccc commit ba72a7a3008a192b4c993a27c8ed5740b4b62677 @hbons committed Mar 3, 2014
Showing with 9 additions and 3 deletions.
  1. +9 −3 SparkleShare/Linux/SparkleSetup.cs
@@ -71,10 +71,16 @@ public void ShowPage (PageType type, string [] warnings)
ActivatesDefault = true
};
- UnixUserInfo user_info = UnixUserInfo.GetRealUser ();
+ try {
+ UnixUserInfo user_info = UnixUserInfo.GetRealUser ();
- if (user_info != null && user_info.RealName != null)
- name_entry.Text = user_info.RealName.TrimEnd (",".ToCharArray ());
+ if (user_info != null && user_info.RealName != null)
+ // Some systems append a series of "," for some reason
+ name_entry.Text = user_info.RealName.TrimEnd (",".ToCharArray ());
+
+ } catch (ArgumentException) {
+ // No username, not a big deal
+ }
Entry email_entry = new Entry () {
Xalign = 0,

0 comments on commit ba72a7a

Please sign in to comment.