Fix NPE in revision state calculation.