fix: handle collectionView() when metadata == nil
This commit is contained in:
@@ -1381,7 +1381,10 @@ extension ViewController: UICollectionViewDataSource, UICollectionViewDelegateFl
|
||||
{
|
||||
if collectionView == comicCollectionView {
|
||||
return comics.count
|
||||
} else {
|
||||
} else if collectionView == scrollingCollectionView {
|
||||
if metadata == nil {
|
||||
return 0
|
||||
}
|
||||
var sum = 0
|
||||
for volume in metadata.volumes {
|
||||
for chapter in volume.chapters {
|
||||
@@ -1390,6 +1393,7 @@ extension ViewController: UICollectionViewDataSource, UICollectionViewDelegateFl
|
||||
}
|
||||
return sum
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)
|
||||
|
||||
Reference in New Issue
Block a user