Check service existence before use in Debug mode
This commit is contained in:
parent
3efbca6c90
commit
0a9e4a3f9d
2 changed files with 20 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue