Skip to content

Commit

Permalink
Fix a crash when updateLoopBtnStatus is called before view loaded, #3164
Browse files Browse the repository at this point in the history
  • Loading branch information
lhc70000 committed Nov 7, 2020
1 parent 5368a8c commit ecf90ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions iina/PlaylistViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class PlaylistViewController: NSViewController, NSTableViewDataSource, NSTableVi
}

func updateLoopBtnStatus() {
guard isViewLoaded else { return }
let loopStatus = player.mpv.getString(MPVOption.PlaybackControl.loopPlaylist)
loopBtn.state = (loopStatus == "inf" || loopStatus == "force") ? .on : .off
}
Expand Down

0 comments on commit ecf90ef

Please sign in to comment.