diff options
author | dahlia | 2014-01-20 11:53:33 -0800 |
---|---|---|
committer | dahlia | 2014-01-20 11:53:33 -0800 |
commit | 1cae3664a52fe48965954afc19804b11720c4add (patch) | |
tree | a0a8364fae29ebc97ab4a0cdd59f3301f0b21f10 | |
parent | update OpenMetaverse.StructuredData to git master (bf4e9f654ff99c85e20b53e56f... (diff) | |
download | opensim-SC_OLD-1cae3664a52fe48965954afc19804b11720c4add.zip opensim-SC_OLD-1cae3664a52fe48965954afc19804b11720c4add.tar.gz opensim-SC_OLD-1cae3664a52fe48965954afc19804b11720c4add.tar.bz2 opensim-SC_OLD-1cae3664a52fe48965954afc19804b11720c4add.tar.xz |
add null texture entry face check before converting legacy materials
-rw-r--r-- | OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index ce2a56a..c4bc8a0 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | |||
@@ -199,7 +199,7 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
199 | bool used = false; | 199 | bool used = false; |
200 | 200 | ||
201 | foreach (var face in te.FaceTextures) | 201 | foreach (var face in te.FaceTextures) |
202 | if (face.MaterialID == id) | 202 | if (face != null && face.MaterialID == id) |
203 | used = true; | 203 | used = true; |
204 | 204 | ||
205 | if (used) | 205 | if (used) |
@@ -207,7 +207,7 @@ namespace OpenSim.Region.OptionalModules.Materials | |||
207 | 207 | ||
208 | var newId = StoreMaterialAsAsset(part.CreatorID, material, part); | 208 | var newId = StoreMaterialAsAsset(part.CreatorID, material, part); |
209 | foreach (var face in te.FaceTextures) | 209 | foreach (var face in te.FaceTextures) |
210 | if (face.MaterialID == id) | 210 | if (face != null && face.MaterialID == id) |
211 | face.MaterialID = newId; | 211 | face.MaterialID = newId; |
212 | } | 212 | } |
213 | } | 213 | } |