浏览代码

fix crash

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 1 年之前
父节点
当前提交
5db510b986
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      iOSClient/Share/NCSharePaging.swift

+ 6 - 1
iOSClient/Share/NCSharePaging.swift

@@ -89,7 +89,12 @@ class NCSharePaging: UIViewController {
 
         pagingViewController.dataSource = self
         pagingViewController.delegate = self
-        pagingViewController.select(index: page.rawValue)
+
+        if page.rawValue < NCBrandOptions.NCInfoPagingTab.allCases.count {
+            pagingViewController.select(index: page.rawValue)
+        } else {
+            pagingViewController.select(index: 0)
+        }
 
         (pagingViewController.view as? NCSharePagingView)?.setupConstraints()
         pagingViewController.reloadMenu()