You'll have to check if the optional model is initialized and then cast to a Model object with .get, as shown in this answer.
.get