From c5395feadd0af49cfdb21f31eae8180330c75c2b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 18 Jan 2009 23:31:13 +0000 Subject: Avoid an invalid cast on legacy data --- OpenSim/Data/MySQL/MySQLAssetData.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 23077f1..d4a7980 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -142,7 +142,14 @@ namespace OpenSim.Data.MySQL asset.Data = (byte[]) dbReader["data"]; asset.Description = (string) dbReader["description"]; asset.FullID = assetID; - asset.Local = (bool)dbReader["local"]; + try + { + asset.Local = (bool)dbReader["local"]; + } + catch (System.InvalidCastException) + { + asset.Local = false; + } asset.Name = (string) dbReader["name"]; asset.Type = (sbyte) dbReader["assetType"]; } -- cgit v1.1