소스 검색

Fix SVGKSource is `nil` assert, when init with URL

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 년 전
부모
커밋
cc21fe6972
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      iOSClient/Menu/UIViewController+Menu.swift

+ 3 - 1
iOSClient/Menu/UIViewController+Menu.swift

@@ -72,7 +72,9 @@ extension UIViewController {
             
             let actions = card.actions.map { action -> NCMenuAction in
                 var image = UIImage()
-                if let url = URL(string: action.icon), let svg = SVGKImage(contentsOf: url) {
+                if let url = URL(string: action.icon),
+                   let svgSource = SVGKSourceURL.source(from: url),
+                   let svg = SVGKImage(source: svgSource) {
                     image = svg.uiImage
                 }
                 return NCMenuAction(