]> err.no Git - sope/blobdiff - sope-core/NGExtensions/FdExt.subproj/NSException+misc.m
fixed a gstep-base issue
[sope] / sope-core / NGExtensions / FdExt.subproj / NSException+misc.m
index 28adb74510b26052e14df2876199b8e0d9f28604..254490be55bd64dbe4a05e726ea9ff7a3ecec837 100644 (file)
 */
 
 #include "NSException+misc.h"
+#import <Foundation/NSNull.h>
 #include "common.h"
 
+@implementation NSObject(NSExceptionNGMiscellaneous)
+
+- (BOOL)isException {
+  return NO;
+}
+- (BOOL)isExceptionOrNull {
+  return NO;
+}
+
+@end /* NSObject(NSExceptionNGMiscellaneous) */
+
+@implementation NSNull(NSExceptionNGMiscellaneous)
+
+- (BOOL)isException {
+  return NO;
+}
+- (BOOL)isExceptionOrNull {
+  return YES;
+}
+
+@end /* NSNull(NSExceptionNGMiscellaneous) */
+
 @implementation NSException(NGMiscellaneous)
 
+- (BOOL)isException {
+  return YES;
+}
+- (BOOL)isExceptionOrNull {
+  return YES;
+}
+
 - (id)initWithReason:(NSString *)_reason {
   return [self initWithReason:_reason userInfo:nil];
 }
@@ -41,9 +71,9 @@
     NSLog(@"ERROR(%s): missing format!", __PRETTY_FUNCTION__);
   
   va_start(ap, _format);
-  tmp = [[NSString allocWithZone:[self zone]]
-                   initWithFormat:_format ? _format : @"Exception"
-                  arguments:ap];
+  tmp = [[NSString alloc] initWithFormat:
+                           _format ? _format : (NSString *)@"Exception"
+                         arguments:ap];
   va_end(ap);
 
   self = [self initWithReason:tmp userInfo:nil];