I was in a shul where there were ten people and one person of the ten was sleeping (I saw him sleeping by the first Aliyah on Shabbos). When the gabbai gave me an Aliyah, I told him that I will not go up until this person is woken, as it is questionable if there is a minyan. When he woke up, another person went to the bathroom, and I told him I cannot take the Aliyah until that one comes out, as they started with 9 people. Did I do the right thing?
It would depend on which aliya they wanted to give you. The Shulchan Aruch 143-1 says that if there was a minyan when they started reading the torah, even if some of the people left, as long as there are six people left they continue to read on Shabbos the seven aliyos. This because of the rule that once a section of davening was started with a minyan, even though some of the people left, they still continue. Maftir however would be considered a new topic regarding this, and it should not be read until there are ten people there.