Add a check for the existence of the model before referring to its property (#2060)
Add a check for the existence of the model before referring to its property (#2060)

* Add a check for the existence of the model before referring to its property

* Add ternary operator indead of returning a null

SaadEddinHassania/voyager,SaadEddinHassania/voyager,handiwijoyo/voyager,the-control-group/voyager,darit/voyager,the-control-group/voyager,handiwijoyo/voyager,fletch3555/voyager,darit/voyager,fletch3555/voyager