Set material from string

Hello,

imagine that I have lot of materials, and I would like to set it into actors dynamically by string.

This is exactly what I want: https://answers.unrealengine.com/questions/705946/how-to-set-material-from-string-variable.html

But after I followed that answer, my editor crashes, I made question about it here: https://answers.unrealengine.com/questions/799571/editor-crashes-after-setting-material.html

So is any other way?