Rihanna is terrified of a stalker who tried breaking into her home -- so she's taking appropriate actions to keep him the heck away from her.

TMZ reports that the singer got a rih-straining order against Steveland Barrow, a macadamia of a fan who tried breaking into her home last Thursday (Feb. 21).

Problem for Barrow was that he actually broke into her neighbor's house instead, sleeping in the bed he presumed to be hers, stealing property and saying he was invited in.

Barrow was released from custody and is nowhere to be found, which is likely a big reason that Rihanna's attorneys demanded the protective order. Barrow has to stay at least 100 yards away from all things RiRi at all times.

It's a little ironic that Rihanna is so concerned with her safety that she takes legal precautions to avoid a potential danger -- yet sleeps with a proven one all the time.

Maybe Barrow would have a better shot if he could dance.