Fixes NoneType error.

Sometimes result is None, i.e. not a Candidate instance.
Merge pull request #58 from boudewijn-tribler/bugfixes

Fixes NoneType error.