diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 1fb01ba1c5..940ae3b0b4 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -510,6 +510,13 @@ namespace OpenSim.Framework
if (te != null && te.Length > 0)
Texture = new Primitive.TextureEntry(te, 0, te.Length);
}
+ else
+ {
+ // We shouldn't be receiving appearance hashtables without a TextureEntry,
+ // but in case we do this will prevent a failure when saving to the database
+ Texture = GetDefaultTexture();
+ }
+
AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]);
diff --git a/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs b/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs
index 7941679660..88918d1142 100644
--- a/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs
+++ b/OpenSim/Grid/UserServer.Modules/UserServerAvatarAppearanceModule.cs
@@ -110,7 +110,12 @@ namespace OpenSim.Grid.UserServer.Modules
if (requestData.Contains("owner"))
{
AvatarAppearance appearance = new AvatarAppearance(requestData);
- m_userDataBaseService.UpdateUserAppearance(new UUID((string)requestData["owner"]), appearance);
+
+ // TODO: Sometime in the future we may have a database layer that is capable of updating appearance when
+ // the TextureEntry is null. When that happens, this check can be removed
+ if (appearance.Texture != null)
+ m_userDataBaseService.UpdateUserAppearance(new UUID((string)requestData["owner"]), appearance);
+
responseData = new Hashtable();
responseData["returnString"] = "TRUE";
}
diff --git a/prebuild.xml b/prebuild.xml
index 0cf88c3aa8..c4d81cce0e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1055,6 +1055,7 @@
+