guard against null weights