Fix NPE caused by fix for bug 338010