From a21b0665feeabc020982f65cfc5328d3ac70939d Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Tue, 29 Apr 2025 12:31:54 +1200 Subject: [PATCH] [Core] Correctly throw an error when using attach to element id with an invalid id --- clay.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clay.h b/clay.h index 9f19d5d..7dbd066 100644 --- a/clay.h +++ b/clay.h @@ -2038,7 +2038,7 @@ void Clay__ConfigureOpenElementPtr(const Clay_ElementDeclaration *declaration) { } } else if (declaration->floating.attachTo == CLAY_ATTACH_TO_ELEMENT_WITH_ID) { Clay_LayoutElementHashMapItem *parentItem = Clay__GetHashMapItem(floatingConfig.parentId); - if (!parentItem) { + if (parentItem == &Clay_LayoutElementHashMapItem_DEFAULT) { context->errorHandler.errorHandlerFunction(CLAY__INIT(Clay_ErrorData) { .errorType = CLAY_ERROR_TYPE_FLOATING_CONTAINER_PARENT_NOT_FOUND, .errorText = CLAY_STRING("A floating element was declared with a parentId, but no element with that ID was found."),