fix possible dereference of null pointer

This commit is contained in:
rfm 2024-03-11 14:36:22 +00:00
parent f6d2806098
commit 61da0dab96
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2024-03-11 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSNotificationCenter.m: Ensure class pointer is initialised
before use (git issue #381).
2024-03-10 Hugo Melder <service@hugomelder.com>
* Headers/Foundation/NSDate.h:
* Source/NSDate.m:

View file

@ -679,6 +679,14 @@ static NSNotificationCenter *default_center = nil;
{
concrete = [GSNotification class];
}
/* Ensure value is initialised before we use it in
* -removeObserver:name:object:
*/
if (nil == GSNotificationObserverClass)
{
[GSNotificationObserver class];
}
/*
* Do alloc and init separately so the default center can refer to
* the 'default_center' variable during initialisation.