If you just created the course without any item inside, you should expect to get an error when trying to run it. Probably it would be better to show a nice error message saying something like "You need to populate your course with items".