Fix bug: crashing when there is no lived server in heartbeat branch

I found one important bug. and fixed it. Thank you.