Based on the error message it seems as if the Dataset.__getitem__ method is returning the None object (or no return statement is used which would then return None by default).
Could you check that the Dataset.__getitem__ is indeed returning valid data?