don't crash when no presets are passed
This commit is contained in:
parent
6d045ff304
commit
1e87393d07
|
@ -150,7 +150,9 @@ func milkbucket(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
defer m.destroy()
|
||||
|
||||
if len(args) > 0 {
|
||||
m.loadPreset(false)
|
||||
}
|
||||
|
||||
running := true
|
||||
for running {
|
||||
|
|
|
@ -67,18 +67,22 @@ func (m *milkDropWindow) setupPresets(presets []string) {
|
|||
* preset.
|
||||
*/
|
||||
func (m *milkDropWindow) nextPreset(smooth bool) {
|
||||
if m.preset.Len() > 0 {
|
||||
m.preset = m.preset.Next()
|
||||
m.loadPreset(smooth)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* prevPreset sets the milkDropWindow's preset to the one before the current
|
||||
* preset.
|
||||
*/
|
||||
func (m *milkDropWindow) prevPreset(smooth bool) {
|
||||
if m.preset.Len() > 0 {
|
||||
m.preset = m.preset.Prev()
|
||||
m.loadPreset(smooth)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* newMilkDropWindow returns a new milkDropWindow with the given width and
|
||||
|
|
Loading…
Reference in New Issue