Prevents viewChange from removing all classes if executed too early
This is a failsafe in cases viewChange is manually triggered too early.
Related to #5579
Merge pull request #5580 from LaurentGoderre/fix-5579

Prevents viewChange from removing all classes if executed too early