you also need to check whether GetCurrentChannel() actually returns a channel, so check the return value