gtk: fix Application to be more robust when embedding mono

When embedding mono, Environment.GetCommandLineArgs() would not return
an array with any element.

Reported in the mailing list, by Vardar Sahin.
This commit is contained in:
Andrés G. Aragoneses 2013-11-02 21:53:20 +01:00
parent 0d781f485f
commit 53e884dd22

View File

@ -64,7 +64,9 @@ namespace Gtk {
static void SetPrgname ()
{
GLib.Global.ProgramName = System.IO.Path.GetFileNameWithoutExtension (Environment.GetCommandLineArgs () [0]);
var args = Environment.GetCommandLineArgs ();
if (args != null && args.Length > 0)
GLib.Global.ProgramName = System.IO.Path.GetFileNameWithoutExtension (args [0]);
}
public static void Init ()