marinofaggiana 5 years ago
parent
commit
3e89857646
1 changed files with 5 additions and 2 deletions
  1. 5 2
      iOSClient/Main/NCDetailViewController.swift

+ 5 - 2
iOSClient/Main/NCDetailViewController.swift

@@ -220,9 +220,12 @@ class NCDetailViewController: UIViewController {
                 
                 if type == "delete" {
                     if viewerImageViewController != nil && self.mediaFilterImage {
-                        if let metadatas = appDelegate.activeMedia.sectionDatasource.metadatas as? [tableMetadata]  {
-                            
+                        if let metadatas = appDelegate.activeMedia.sectionDatasource.metadatas as? [tableMetadata] {
                             self.metadatas = metadatas
+                        }
+                        
+                        if metadatas.count > 0 {
+                            
                             var index = viewerImageViewController!.index - 1
                             if index < 0 { index = 0}
                             self.metadata = metadatas[index]