Unless you have done something, inadvertently or on purpose, to make the other friend not like you, then the mutual friend is being kind of rude to simply throw you out, when the other friend comes calling.
I’m guessing there might be more to this story than you’re letting us know. Care to share a little more?
How long have you known the mutual friend and are you very close, and has this relationship changed recently (beyond this particular situation with the person who doesn’t like you).
Is there a reason you suspect the other friend doesn’t like you? Has your mutual friend told you why the other person doesn’t like you? Is it possible that the other person is jealous of your friendship? Is it possible that you did something, on purpose or not, that upset the other friend, like coming on to his girlfriend or simply having a potty mouth, or lying/exaggerating/gossiping about him? Think hard before you answer these questions, I’m sure you have some idea why the other person doesn’t like you.
As for your mutual friend, in general, I think it is very rude of him to kick you out the door whenever this other friend comes calling, but I’m wondering if the mutual friend is trying to somehow balance all of this without losing both of you (and just not doing a very good job of it).
I once had a very good friend, for about 10 years, once her longtime boyfriend dumped her, she became very insecure and started gravitating to people (males and females) that weren’t the nicest people. One in particular was this very annoying/stupid/jealous girl that only wanted to hang around with my friend one on one. She didn’t want anyone else to be around when they were hanging out. My friend was used to having everyone know each other and get along, so on the few times we all hung out together, I got a really bad vibe from this other girl (even though I had done nothing to offend her) and I could tell that she was very clingy and insecure. Because the clingy girl was also useful to my friend, in a financial way and because their boyfriends were friends, lending that to couples nights out, I got relegated to the back burner. This friend even told me that the girl was clingy and insecure, but she explained that she needed her financial support for a business she was starting. My friend started making a lot of bad choices and kept making and breaking plans with me, until I had finally had enough. I realized that although we had been very good and close friends for a long time, I didn’t fit into the new scheme of her life. And poof! I was out of her life.
If this mutual friend is someone who you value, have a heart to heart talk with him about the other friend. Try to find out exactly why the other person doesn’t like you, and either make amends to that person, or explain to your friend that you are rather hurt by being kicked to the curb whenever this other person comes along, and what would he suggest doing to remedy this situation. If, on the other hand, your friend has changed, consider walking away from the situation.