Fix a fatal

PHP Fatal error: Cannot access empty property
Yup, you're right. I'll add the test.