mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
Fix a panic when failing to load some images in a diff
This commit is contained in:
@@ -138,7 +138,9 @@ func (self *ImageCollection) ResizeForPageSize(width, height int) {
|
||||
ctx.Parallel(0, len(keys), func(nums <-chan int) {
|
||||
for i := range nums {
|
||||
img := self.images[keys[i]]
|
||||
img.ResizeForPageSize(width, height)
|
||||
if img.src.loaded && img.err == nil {
|
||||
img.ResizeForPageSize(width, height)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -298,6 +300,7 @@ func (self *ImageCollection) LoadAll() {
|
||||
if img.err == nil {
|
||||
img.src.size.Width, img.src.size.Height = img.src.data.Width, img.src.data.Height
|
||||
}
|
||||
img.src.loaded = true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user