Permalink
Browse files

Fixed NULL checks

  • Loading branch information...
1 parent 96f352d commit ccc92373cb78f22a2b6fd25ff2c2976490f2e706 @AndiDog committed Oct 31, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 iOS/TabBar/2.1.0 (non-ARC)/TabBar.m
@@ -177,9 +177,9 @@ - (void)create:(CDVInvokedUrlCommand*)command
tabBar.userInteractionEnabled = YES;
tabBar.opaque = YES;
- const NSDictionary *options = command ? [command.arguments objectAtIndex:0] : nil;
+ const id options = command ? [command.arguments objectAtIndex:0] : nil;
- if(options)
+ if(options && options != [NSNull null])
{
id iconTint = [options objectForKey:@"selectedImageTintColorRgba"];
id tint = [options objectForKey:@"tintColorRgba"];
@@ -217,9 +217,9 @@ - (void)show:(CDVInvokedUrlCommand*)command
if (!tabBar.hidden)
return;
- const NSDictionary *options = [command.arguments objectAtIndex:0];
+ const id options = [command.arguments objectAtIndex:0];
- if(options)
+ if(options && options != [NSNull null])
{
id tabBarHeightOpt = [options objectForKey:@"height"];
id positionOpt = [options objectForKey:@"position"];
@@ -300,7 +300,7 @@ - (void)createItem:(CDVInvokedUrlCommand*)command
if (!tabBar)
[self create:nil];
- const NSDictionary *options = [command.arguments objectAtIndex:4];
+ const id options = [command.arguments objectAtIndex:4];
NSString *name = [command.arguments objectAtIndex:0];
NSString *title = [command.arguments objectAtIndex:1];
@@ -330,7 +330,7 @@ - (void)createItem:(CDVInvokedUrlCommand*)command
if (item == nil)
item = [[UITabBarItem alloc] initWithTitle:title image:[UIImage imageNamed:imageName] tag:tag];
- if(options)
+ if(options && options != [NSNull null])
{
id badgeOpt = [options objectForKey:@"badge"];

0 comments on commit ccc9237

Please sign in to comment.