Fixed possible crash in presence handling.

An unhandled tag might cause crash in presence handling.