Throwing an assertion and breaking the program should allow developers to catch wrong usage of the API faster. Follow-up of 9493e6974f70a906950c9d8196c9a9982300f261
@@ -43,9 +43,11 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,
{
int posted;
- if (!SDL_ObjectValid(window, SDL_OBJECT_TYPE_WINDOW)) {
+ if (!window) {
return 0;
}
+ SDL_assert(SDL_ObjectValid(window, SDL_OBJECT_TYPE_WINDOW));
+
if (window->is_destroying && windowevent != SDL_EVENT_WINDOW_DESTROYED) {