Fix #391 - Added empty check.
Merge pull request #392 from vreixo/issue391

Fix #391 - Added empty check.