Skip to content
This repository was archived by the owner on Jun 17, 2018. It is now read-only.

Commit d5e6075

Browse files
committed
Exit if first or last doesn't exist
1 parent 8ae8466 commit d5e6075

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Pod/Classes/MenuView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ open class MenuView: UIScrollView {
313313
default: return
314314
}
315315

316-
let firstMenuView = menuItemViews.first!
317-
let lastMenuView = menuItemViews.last!
316+
guard let firstMenuView = menuItemViews.first,
317+
let lastMenuView = menuItemViews.last else { return }
318318

319319
var inset = contentInset
320320
let halfWidth = frame.width / 2

0 commit comments

Comments
 (0)