fix null pointer access

This commit is contained in:
2026-06-01 02:58:20 +02:00
parent 65f69d5c75
commit 6738051da1
2 changed files with 10 additions and 4 deletions

View File

@@ -34,9 +34,11 @@ import java.util.List;
import java.util.Map;
/**
* The real terminal renderer: paints a pane's background, cell rows, cursor, border, padding
* and (when enabled) kitty graphics. One instance per pane, since it caches that pane's
* decoded kitty images.
* The real terminal renderer: rasterizes a pane's background, cell rows, cursor, border and
* padding into the {@link SoftwareBackbuffer} and blits it to the canvas. Kitty images are not
* drawn here — each paint collects their placements (see {@link #kittyImages()}) for the
* compositor to render as overlay nodes above the canvas. One instance per pane, since it caches
* that pane's decoded kitty images.
*/
final class GhosttyTerminalRenderer extends TerminalRenderer {
// GhosttyRenderStateDirty values (stable C ABI; see ghostty/vt/render.h).

View File

@@ -58,9 +58,13 @@ final class KittyImageOverlay {
for (TerminalPane pane : panes) {
updatePane(pane);
}
// Only panes that actually have images get a group; order those to match pane z-order.
List<Node> ordered = new ArrayList<>(panes.size());
for (TerminalPane pane : panes) {
ordered.add(overlays.get(pane).group);
PaneOverlay overlay = overlays.get(pane);
if (overlay != null) {
ordered.add(overlay.group);
}
}
if (!root.getChildren().equals(ordered)) {
root.getChildren().setAll(ordered);