diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs')
-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 | } |