mirror of https://github.com/encounter/SDL.git
SDL_UDEV_DelCallback: return early if _this is NULL
Fixes https://github.com/libsdl-org/SDL/issues/6548
This commit is contained in:
parent
16824865c2
commit
6dc96aa745
|
@ -545,6 +545,10 @@ SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
|
||||||
SDL_UDEV_CallbackList *item;
|
SDL_UDEV_CallbackList *item;
|
||||||
SDL_UDEV_CallbackList *prev = NULL;
|
SDL_UDEV_CallbackList *prev = NULL;
|
||||||
|
|
||||||
|
if (_this == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (item = _this->first; item != NULL; item = item->next) {
|
for (item = _this->first; item != NULL; item = item->next) {
|
||||||
/* found it, remove it. */
|
/* found it, remove it. */
|
||||||
if (item->callback == cb) {
|
if (item->callback == cb) {
|
||||||
|
|
Loading…
Reference in New Issue