fix a set-but-unused-variable warning
(cherry picked from commit ce9ea1170170d36f4cca349bc16f1c57dd4f40ec)