check for nil before parsing integers
Merge pull request #43 from rivernate/moodle2

check for nil before parsing integers