TOON: Add a safeguard to avoid dereferencing a null pointer in playAnim()