Browse Source

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

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 years ago
parent
commit
cc21fe6972
1 changed files with 3 additions and 1 deletions
  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(