Fixed NPE if there is no directory under versions folder.