Chapter 10: Added missing null-check.