idiom

A fair-weather friend.

Theme: friendship Keyword: friend

means

A person who offers friendship only while circumstances are pleasant or advantageous.

Example

His fair-weather friends disappeared when he ran into financial trouble.