From af6fd7b93fb1eba0786d23095b8803c8c2885ddb Mon Sep 17 00:00:00 2001 From: Rolson Quadras Date: Tue, 3 Sep 2024 13:01:10 -0400 Subject: [PATCH] fix(sdk): add attachment type check (#809) Signed-off-by: Rolson Quadras --- cmd/wallet-sdk-gomobile/display/displaydata.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/wallet-sdk-gomobile/display/displaydata.go b/cmd/wallet-sdk-gomobile/display/displaydata.go index deb7072d..ee0ce2cd 100644 --- a/cmd/wallet-sdk-gomobile/display/displaydata.go +++ b/cmd/wallet-sdk-gomobile/display/displaydata.go @@ -310,6 +310,10 @@ func (c *Attachment) ID() string { // For RemoteAttachment, the uri will be a remote HTTP URL. Hash and HashAlg will provide the hash value of the data along with Hash algorithm used to generate the hash. Consumer of this API need to validate the hash value against the hash of the data object retrieved from the remote url // For AttachmentEvidence, the uri will be empty. But the hash and hashAlg will provide the hash value of the data along with Hash algorithm used to generate the hash. Consumer of this API need to validate the hash value against the hash of the data object retrieved from the out of band. func (c *Attachment) Type() string { + if len(c.attachment.Type) == 0 { + return "" + } + return c.attachment.Type[0] }