How do I set an actor's static mesh in the editor, but change the material in code?

RootComponent needs to be set in the constructor, resetting it at runtime might result in that crash (I doubt it though, but it shouldn’t work).