浏览代码

1, lastBnnerSelectIndex 初始化 2,添加判断

jsonwang 4 年之前
父节点
当前提交
ceb4a7ff9a

+ 2 - 2
MusicVideoPlus/MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -78,7 +78,7 @@ class MVHomeController: MVBaseController {
 
 
     var mAllVideos: Array = Array<PQVideoListModel>.init()
     var mAllVideos: Array = Array<PQVideoListModel>.init()
 
 
-    var lastBnnerSelectIndex: IndexPath = IndexPath()
+    var lastBnnerSelectIndex: IndexPath = IndexPath.init(row: 0, section: 0)
     
     
     //是否点击的再创作
     //是否点击的再创作
     var isCreateVideo:Bool = false
     var isCreateVideo:Bool = false
@@ -319,7 +319,7 @@ class MVHomeController: MVBaseController {
 
 
     // 再创作视频
     // 再创作视频
     func createVideo(indexPath: IndexPath) {
     func createVideo(indexPath: IndexPath) {
-        if(enableLogin()){
+        if(enableLogin() && mAllVideos.count > indexPath.row){
             PQStuckPointViewModel.stuckPointProjectMusicInfo(projectId: mAllVideos[indexPath.row].reCreateVideoData?.projectId ?? "") { musicData, _ in
             PQStuckPointViewModel.stuckPointProjectMusicInfo(projectId: mAllVideos[indexPath.row].reCreateVideoData?.projectId ?? "") { musicData, _ in
                 if musicData != nil {
                 if musicData != nil {
                     let vc = PQStuckPointMaterialController()
                     let vc = PQStuckPointMaterialController()