Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local reference 'updatedEvent' is never used #15

Open
jespirit opened this issue Oct 13, 2018 · 1 comment
Open

Local reference 'updatedEvent' is never used #15

jespirit opened this issue Oct 13, 2018 · 1 comment
Labels
style Formatting and semantic changes

Comments

@jespirit
Copy link
Contributor

Event updatedEvent;
try
{
updatedEvent = EventParser.ParseUpdateEvent(evt, args, timezone);
}
catch (DateTimeInPastException)
{
await ctx.RespondAsync("Cannot create an event that starts or ends in the past, or has a reminder that is in the past.");
return;
}
catch (EventEndBeforeStartException)
{
await ctx.RespondAsync("Cannot create an event that ends before it starts.");
return;
}
catch (EventParseException)
{
await ctx.RespondAsync("Failed to parse event data.");
return;
}
Event savedEvent;
savedEvent = await _eventService.UpdateEventAsync(evt);

Line 243 should be:

savedEvent = await _eventService.UpdateEventAsync(updatedEvent);
@pyrox18
Copy link
Owner

pyrox18 commented Oct 25, 2018

Yup, that should be changed, though it works now since the same Event object is being referenced by both evt and updatedEvent.

Should also change the RescheduleEvent call in line 246 to pass savedEvent as an argument instead of evt.

@pyrox18 pyrox18 added enhancement New feature or request style Formatting and semantic changes and removed enhancement New feature or request labels Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
style Formatting and semantic changes
Projects
None yet
Development

No branches or pull requests

2 participants