handle missing profile

This commit is contained in:
Celogeek 2024-04-28 21:36:26 +02:00
parent 5968cbdd09
commit cc7a97ad6f
Signed by: celogeek
SSH Key Fingerprint: SHA256:njNJLzoLQdbV9PC6ehcruRb0QnEgxABoCYZ+0+aUIYc

View File

@ -241,7 +241,11 @@ func (o *Options) ShowConfig() string {
if o.AspectRatio > 0 { if o.AspectRatio > 0 {
aspectRatio = fmt.Sprintf("1:%.02f", o.AspectRatio) aspectRatio = fmt.Sprintf("1:%.02f", o.AspectRatio)
} else if o.AspectRatio < 0 { } else if o.AspectRatio < 0 {
aspectRatio = fmt.Sprintf("1:%0.2f (device)", float64(profile.Height)/float64(profile.Width)) if profile != nil {
aspectRatio = fmt.Sprintf("1:%0.2f (device)", float64(profile.Height)/float64(profile.Width))
} else {
aspectRatio = "1:?? (device)"
}
} }
titlePage := "" titlePage := ""