mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-21 12:11:29 +00:00
Raise an exception in init methods when called with nil nib file name
or nil owner git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11087 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1b792f83c7
commit
cd967093fd
1 changed files with 19 additions and 8 deletions
|
@ -34,7 +34,19 @@
|
||||||
|
|
||||||
- (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner
|
- (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner
|
||||||
{
|
{
|
||||||
[self initWithWindow: nil];
|
if (windowNibName == nil)
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"attempt to init NSWindowController with nil windowNibName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (owner == nil)
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"attempt to init NSWindowController with nil owner"];
|
||||||
|
}
|
||||||
|
|
||||||
|
self = [self initWithWindow: nil];
|
||||||
ASSIGN (_windowNibName, windowNibName);
|
ASSIGN (_windowNibName, windowNibName);
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
return self;
|
return self;
|
||||||
|
@ -42,7 +54,7 @@
|
||||||
|
|
||||||
- (id) initWithWindow: (NSWindow *)window
|
- (id) initWithWindow: (NSWindow *)window
|
||||||
{
|
{
|
||||||
[super init];
|
self = [super init];
|
||||||
|
|
||||||
ASSIGN (_window, window);
|
ASSIGN (_window, window);
|
||||||
_windowFrameAutosaveName = @"";
|
_windowFrameAutosaveName = @"";
|
||||||
|
@ -59,7 +71,7 @@
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
return [self initWithWindowNibName: nil];
|
return [self initWithWindow: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -161,7 +173,6 @@
|
||||||
{
|
{
|
||||||
_window = nil;
|
_window = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
[_document _removeWindowController: self];
|
[_document _removeWindowController: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue