Set material from string


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:

But after I followed that answer, my editor crashes, I made question about it here:

So is any other way?