mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Added an error message when SDL_GetWindowFromID() fails
This commit is contained in:
parent
e058aa6d65
commit
2c1d40a9eb
1 changed files with 7 additions and 3 deletions
|
|
@ -2649,13 +2649,17 @@ SDL_Window *SDL_GetWindowFromID(SDL_WindowID id)
|
|||
SDL_Window *window;
|
||||
|
||||
if (!_this) {
|
||||
SDL_UninitializedVideo();
|
||||
return NULL;
|
||||
}
|
||||
for (window = _this->windows; window; window = window->next) {
|
||||
if (window->id == id) {
|
||||
return window;
|
||||
if (id) {
|
||||
for (window = _this->windows; window; window = window->next) {
|
||||
if (window->id == id) {
|
||||
return window;
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_SetError("Invalid window ID"); \
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue