MODE-2071 Corrected NPE in upgraded repository from 3.2

An NPE can occur when upgrading from 3.2 to 3.5, and the code was changed to prevent this NPE.