diff --git a/src/Crypto.php b/src/Crypto.php
index <HASH>..<HASH> 100644
--- a/src/Crypto.php
+++ b/src/Crypto.php
@@ -60,7 +60,7 @@ class Crypto
 
         // TODO: requester public key
 
-        if ($transaction->recipientId) {
+        if (isset($transaction->recipientId)) {
             $out .= \BitWasp\Bitcoin\Base58::decodeCheck($transaction->recipientId)->getBinary();
         } else {
             $out .= pack('x21');
fix: check if recipient is set