Skip to content

Commit 2fd6bf7

Browse files
committed
Fix failing test
Error responses must be sent for put commands that refer non-existent images
1 parent d10681f commit 2fd6bf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kitty/graphics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,9 @@ handle_put_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c, b
574574
if (img == NULL) {
575575
if (g->id) img = img_by_client_id(self, g->id);
576576
else if (g->image_number) img = img_by_client_number(self, g->image_number);
577-
if (img == NULL) { set_command_failed_response("ENOENT", "Put command refers to non-existent image with id: %u and number: %u", g->id, g->image_number); return 0; }
577+
if (img == NULL) { set_command_failed_response("ENOENT", "Put command refers to non-existent image with id: %u and number: %u", g->id, g->image_number); return g->id; }
578578
}
579-
if (!img->data_loaded) { set_command_failed_response("ENOENT", "Put command refers to image with id: %u that could not load its data", g->id); return 0; }
579+
if (!img->data_loaded) { set_command_failed_response("ENOENT", "Put command refers to image with id: %u that could not load its data", g->id); return img->client_id; }
580580
ensure_space_for(img, refs, ImageRef, img->refcnt + 1, refcap, 16, true);
581581
*is_dirty = true;
582582
self->layers_dirty = true;

0 commit comments

Comments
 (0)