marinofaggiana 4 years ago
parent
commit
405e433810
1 changed files with 1 additions and 0 deletions
  1. 1 0
      iOSClient/Media/NCMedia.swift

+ 1 - 0
iOSClient/Media/NCMedia.swift

@@ -1025,6 +1025,7 @@ class NCGridMediaLayout: UICollectionViewFlowLayout {
                 }
                 
                 frameWidth = collectionView.frame.width
+                if itemForLine <= 0 { itemForLine = 1 }
                 itemWidth = (frameWidth - marginLeftRight * 2 - marginLeftRight * (itemForLine - 1)) / itemForLine
                 
                 return CGSize(width: itemWidth, height: itemWidth)