Skip to content

Post latest changes, the app breaks if ContentSafety is disabled in appsettings. #218

@saisescapades

Description

@saisescapades

Describe the bug
Object reference error observed in DocumentImportController.cs.

To Reproduce

  • In Copilot API's appsettings.json, set the ContentSafety setting's Enabled property to false
  • Launch the application in debugging mode.
  • Refresh the copilot UI.
  • Navigate to the ContentSafetyStatus method within DocumentImportController.cs.
  • Object reference error is thrown on this line: return this._contentSafetyService!.ContentSafetyStatus(this._logger);

Expected behavior
This error has cropped up after changes made around Content Safety. Application should work fine even when ContentSafety setting's Enabled property is set to false. Error is not encountered when ContentSafety setting's Enabled property is set to true

Screenshots
image

Platform

  • OS: Windows
  • IDE: Visual Studio
  • Language: C#
  • Source: main branch of Chat Copilot

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingexternal dependency issueIssues related to external dependencies (e.g. Azure)webapiPull requests that update .net code

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions