return early on error, stop using isNull() when it is an empty block - better than #513