Fullscreen toggle & don't crash when saving null fields

This commit is contained in:
Paul Chote
2010-07-10 15:42:50 +12:00
parent 636bfd5e0a
commit 77405a7700
6 changed files with 44 additions and 11 deletions

View File

@@ -149,6 +149,9 @@ namespace OpenRA.FileFormats
public static string FormatValue(object o, FieldInfo f)
{
var v = f.GetValue(o);
if (v == null)
return "";
return f.FieldType.IsArray
? string.Join(",", ((Array)v).OfType<object>().Select(a => a.ToString()).ToArray())
: v.ToString();