Max Ehrich says his run-in with an obsessed fan who allegedly pulled a gun on him served as a stark wake-up call ... walls must exist between him and his online admirers.
We got the 'Young and the Restless' star Tuesday night at Katsuya in Brentwood where he recounted the terrifying incident -- during which he claims a realtor who was showing him properties got sexually aggressive with him ... and, after being rebuffed, allegedly pulled a piece.
He tells us something even scarier -- apparently, Max was being stalked on IG for a solid two months ... and he implies the culprit was the realtor.
Max also says he's considering getting a gun, but isn't pulling the trigger since he's got armed security rolling with him now.
We'll let Max explain the valuable lesson he's learned for himself after all this -- it's one that applies to anyone, really, but especially celebs these days.
One thing's for sure though ... his life will never be the same again.