Fix nil pointer crash in Convert module benchmark indicator

When benchmark settings are already applied, benchmarkIndicator is nil but was
being added to the container unconditionally, causing a crash during UI layout.

Changes:
- Conditionally build back bar items array
- Only append benchmarkIndicator if it's not nil
- Prevents SIGSEGV when opening Convert module with applied benchmark

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Stu Leak 2025-12-29 00:13:24 -05:00
parent e951f40894
commit 88b318c5e4

14
main.go
View File

@ -6318,15 +6318,19 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
}
}
backBar := ui.TintedBar(convertColor, container.NewHBox(
// Build back bar with optional benchmark indicator
backBarItems := []fyne.CanvasObject{
back,
layout.NewSpacer(),
navButtons,
layout.NewSpacer(),
benchmarkIndicator,
cmdPreviewBtn,
queueBtn,
))
}
if benchmarkIndicator != nil {
backBarItems = append(backBarItems, benchmarkIndicator)
}
backBarItems = append(backBarItems, cmdPreviewBtn, queueBtn)
backBar := ui.TintedBar(convertColor, container.NewHBox(backBarItems...))
var updateCover func(string)
var coverDisplay *widget.Label