From 098358076ddaba387284c1757a80bfcc5d82191f Mon Sep 17 00:00:00 2001 From: YangJH Date: Tue, 26 Mar 2024 21:55:11 +0900 Subject: [PATCH] fix(iOS): throw when content id defined with empty string (#3612) --- ios/Video/Features/RCTVideoDRM.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/Video/Features/RCTVideoDRM.swift b/ios/Video/Features/RCTVideoDRM.swift index cea37a1a..d3cf2ec6 100644 --- a/ios/Video/Features/RCTVideoDRM.swift +++ b/ios/Video/Features/RCTVideoDRM.swift @@ -149,7 +149,9 @@ enum RCTVideoDRM { ) -> Promise { let url = loadingRequest.request.url - guard let contentId = contentId ?? url?.absoluteString.replacingOccurrences(of: "skd://", with: "") else { + let parsedContentId = contentId != nil && !contentId!.isEmpty ? contentId : nil + + guard let contentId = parsedContentId ?? url?.absoluteString.replacingOccurrences(of: "skd://", with: "") else { return Promise(RCTVideoError.invalidContentId as! Error) }