wordpress-mobile/WordPress-iOS

Crash: showPostStatusSelector attempt to insert nil object from objects[4]

Closed this issue · 3 comments

Sentry Issue: WORDPRESS-IOS-2R6R

NSInvalidArgumentException: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[4]
  File "PostSettingsViewController.m", line 1066, in -[PostSettingsViewController showPostStatusSelector]
  File "PostSettingsViewController.m", line 600, in -[PostSettingsViewController tableView:didSelectRowAtIndexPath:]
  File "main.swift", line 7, in main
...
(19 additional frame(s) were not displayed)

Thanks for reporting! 👍

The crash occurrence is relatively small at 6 occurrences for version 24.7 so far. Assigning a medium priority.

Looks like it's crashing here:

NSDictionary *statusDict = @{
@"DefaultValue": [self.apost availableStatusForPublishOrScheduled],
@"Title" : NSLocalizedString(@"Status", nil),
@"Titles" : titles,
@"Values" : statuses,
@"CurrentValue" : self.apost.status
};

Based on the exception message attempt to insert nil object from objects[4], it seems that this crashed because self.apost.status is nil.

Closing this as a duplicate of #22937.