fixed attribute error 'None doesn`t have attr'

when model_cls is None, it doesn`t have any attribute.