Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Protect against empty context menus in edit task #236

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions View Controllers/TaskEditViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ - (void) priorityWasSelected:(NSInteger *)selectedIndex element:(id)element {

- (void) projectWasSelected:(NSInteger *)selectedIndex element:(id)element {
self.actionSheetPicker = nil;
if (selectedIndex >= 0) {
id<TaskBag> taskBag = self.appDelegate.taskBag;
id<TaskBag> taskBag = self.appDelegate.taskBag;
if (selectedIndex >= 0 && [[taskBag projects] count ] > 0) {
NSString *item = [[taskBag projects] objectAtIndex:selectedIndex];

if (! [TaskUtil taskHasProject:self.textView.text project:item]) {
Expand All @@ -429,8 +429,8 @@ - (void) projectWasSelected:(NSInteger *)selectedIndex element:(id)element {

- (void) contextWasSelected:(NSInteger *)selectedIndex element:(id)element {
self.actionSheetPicker = nil;
if (selectedIndex >= 0) {
id<TaskBag> taskBag = self.appDelegate.taskBag;
id<TaskBag> taskBag = self.appDelegate.taskBag;
if (selectedIndex >= 0 && [[taskBag contexts] count] > 0) {
NSString *item = [[taskBag contexts] objectAtIndex:selectedIndex];

if (! [TaskUtil taskHasContext:self.textView.text context:item]) {
Expand Down