fixed access to tx.error in case tx is None
Merge pull request #898 from Tafelpoot/tx_fix

fixed access to tx.error in case tx is None