Isn't `if model is not None:` enough here?