Material doesn't have a color property '_Color' "run-time error"

Hi, How do I prevent the run-time error: Material doesn't have a color property '_Color' UnityEngine.Material:get_color()

I tried the following:

if (GetComponent<Renderer>( )) {
 //do stuff if Renderer Component Exists
}

yet I still receive the error.

Look at the shader you're using and see what properties it has. If you're changing renderer.material.color, as the docs mention, that's a shortcut for SetColor("_Color", color), so if there is no _Color property, it won't work, and you need to use SetColor with the correct name instead.