fixed access to tx.error in case tx is None