SDL_UDEV_DelCallback: return early if _this is NULL

Fixes https://github.com/libsdl-org/SDL/issues/6548
(cherry picked from commit 6dc96aa745)
This commit is contained in:
Ozkan Sezer 2022-11-18 18:02:10 +03:00
parent 4d605ae002
commit c1307133ce

View file

@ -544,6 +544,10 @@ SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
SDL_UDEV_CallbackList *item;
SDL_UDEV_CallbackList *prev = NULL;
if (_this == NULL) {
return;
}
for (item = _this->first; item != NULL; item = item->next) {
/* found it, remove it. */
if (item->callback == cb) {