ui/common/context.c

changeset 476
31213068c2ba
parent 474
971dd0f3a117
child 486
a5f3abf8b9d1
--- a/ui/common/context.c	Mon Feb 24 22:08:27 2025 +0100
+++ b/ui/common/context.c	Wed Feb 26 17:06:56 2025 +0100
@@ -139,8 +139,8 @@
 
 void uic_context_detach_document2(UiContext *ctx, void *document) {
     // find the document in the documents list
-    ssize_t docIndex = cxListFind(ctx->documents, document);
-    if(docIndex < 0) {
+    size_t docIndex = cxListFind(ctx->documents, document);
+    if(!cxListIndexValid(ctx->documents, docIndex)) {
         return;
     }
     

mercurial