Fix NPE error in 7cb51c4c7d.