Game Configurations: fixed a crash when no default values for UDMF integer or floating point fields are set

This commit is contained in:
biwa 2023-10-07 09:24:29 +02:00
parent 682c4b92bf
commit 6e7eaf0359
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ namespace CodeImp.DoomBuilder.Types
public override void SetupField(TypeHandlerAttribute attr, UniversalFieldInfo fieldinfo)
{
defaultvalue = fieldinfo == null ? 0.0 : (double)fieldinfo.Default;
defaultvalue = (fieldinfo == null || fieldinfo.Default == null) ? 0.0 : (double)fieldinfo.Default;
base.SetupField(attr, fieldinfo);
}

View file

@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder.Types
public override void SetupField(TypeHandlerAttribute attr, UniversalFieldInfo fieldinfo)
{
defaultvalue = fieldinfo == null ? 0 : (int)fieldinfo.Default;
defaultvalue = (fieldinfo == null || fieldinfo.Default == null) ? 0 : (int)fieldinfo.Default;
base.SetupField(attr, fieldinfo);
}