Why does Sprite-Default disappear when I change renderer.material.color?

From my script, I performed this on my 2D prefab:

	thePrefab.renderer.material.color = Color.red;

But when I do that, “Material = Sprite-default” becomes “Material = Type mismatch”.

How can I make sure that Material stays set to Sprite-default?

Thanks in advance

Are you sure you want to alter the prefab? It’s more likely you would be operating on a prefab instance, not the prefab (which would only work in the editor).

–Eric