Check service existence before use in Debug mode
This commit is contained in:
@ -302,6 +302,9 @@ namespace Yavsc.Controllers
|
||||
public async Task<IActionResult> SetGoogleCalendar(string returnUrl, string pageToken)
|
||||
|
||||
{
|
||||
#if Debug
|
||||
if (_calendarManager==null) throw new Exception("No service!");
|
||||
#endif
|
||||
var calendar = await _calendarManager.GetCalendarsAsync(User.GetUserId(), pageToken);
|
||||
if (calendar == null)
|
||||
return new ChallengeResult();
|
||||
|
Reference in New Issue
Block a user