Throw an exception on NULL response

Fixes #148