fix: Adds more null checks for text definition to prevent NPEs (#936)
This commit is contained in:
parent
04909828c8
commit
2009ac6892
8 changed files with 82 additions and 61 deletions
|
|
@ -28,21 +28,24 @@ namespace Server.Gumps
|
|||
AddImageTiled(10, 40, width - 20, height - 80, 2624);
|
||||
AddAlphaRegion(10, 40, width - 20, height - 80);
|
||||
|
||||
if (content.Number > 0)
|
||||
if (content != null)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
if (content.Number > 0)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
AddImageTiled(10, height - 30, width - 20, 20, 2624);
|
||||
|
|
|
|||
|
|
@ -28,21 +28,24 @@ namespace Server.Gumps
|
|||
AddImageTiled(10, 40, width - 20, height - 80, 2624);
|
||||
AddAlphaRegion(10, 40, width - 20, height - 80);
|
||||
|
||||
if (content.Number > 0)
|
||||
if (content != null)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
if (content.Number > 0)
|
||||
{
|
||||
AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(
|
||||
10,
|
||||
40,
|
||||
width - 20,
|
||||
height - 80,
|
||||
$"<BASEFONT COLOR=#{contentColor:X6}>{content.String}</BASEFONT>",
|
||||
false,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
AddImageTiled(10, height - 30, width - 20, 20, 2624);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue