Linux Compile error if Color is compared against null. Documentation for System.Drawing.Color says it returns a Color with all Components as 0 if the String passed isn't a known color, so the null check has been commented out

0.6.0-stable
Teravus Ovares 2008-03-09 13:04:58 +00:00
parent 3e47389f9a
commit 7a9e572e8a
1 changed files with 8 additions and 3 deletions

View File

@ -229,12 +229,17 @@ namespace OpenSim.Region.Environment.Modules
{ {
nextLine = nextLine.Remove(0, 9); nextLine = nextLine.Remove(0, 9);
nextLine = nextLine.Trim(); nextLine = nextLine.Trim();
// Linux Compile error if Color is compared against null
// Documentation for System.Drawing.Color says it returns
// a Color with all Components as 0 if the String passed
// isn't a known color
Color newColour = Color.FromName(nextLine); Color newColour = Color.FromName(nextLine);
if (newColour != null) //if (newColour != null)
{ //{
myBrush.Color = newColour; myBrush.Color = newColour;
drawPen.Color = newColour; drawPen.Color = newColour;
} //}
} }
} }
} }