Skip to content

Commit 970bfe5

Browse files
committed
Fix nil Metrics panic in results view and add --edns-size TUI flag parsing
1 parent d60ccce commit 970bfe5

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

internal/tui/screen_results.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ func viewResults(m Model) string {
117117
r := m.report.Passed[i]
118118
row := fmt.Sprintf(" %-4d %-17s", i+1, r.IP)
119119
for _, k := range metricKeys {
120-
if v, ok := r.Metrics[k]; ok {
120+
if r.Metrics == nil {
121+
row += fmt.Sprintf(" %-12s", "-")
122+
} else if v, ok := r.Metrics[k]; ok {
121123
row += fmt.Sprintf(" %-12s", formatMetric(v))
122124
} else {
123125
row += fmt.Sprintf(" %-12s", "-")

internal/tui/screen_welcome.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ func parseCLIFlags(m *Model, raw string) {
145145
m.config.SkipNXDomain = true
146146
case "--edns":
147147
m.config.EDNS = true
148+
case "--edns-size":
149+
if next != "" {
150+
fmt.Sscanf(next, "%d", &m.config.EDNSSize)
151+
m.configInputs[txtEDNSSize].SetValue(next)
152+
i++
153+
}
148154
case "--e2e":
149155
m.config.E2E = true
150156
case "--doh":

0 commit comments

Comments
 (0)