That describes what I would call a "fair-weather friend". I don't think there's a specific word in English for it. A hypocrite would treat you like garbage for not having a job, despite the fact that he doesn't have a job either.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.