[BUGFIX] (Command): Add a safeguard if class does not exist
Sometimes, when the reflection cache is corrupted, it can happen
that a class which does not exist anymore is still part of the cache.
This change makes sure we only loop over available classes, silently
skipping over other ones.