client: fix possible div/0 issue