Skip to content

Commit

Permalink
If Appid doesn't exist, exit
Browse files Browse the repository at this point in the history
  • Loading branch information
darjoo committed Sep 10, 2024
1 parent a79dbfb commit 36e8cf1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ codeunit 7771 "Azure OpenAI"
/// <returns>True if API and capability is enabled for environment.</returns>
procedure IsEnabled(CopilotCapability: Enum "Copilot Capability"; Silent: Boolean; AppId: Guid): Boolean
var
CallerModuleInfo: ModuleInfo;
AppModuleInfo: ModuleInfo;
begin
NavApp.GetModuleInfo(AppId, CallerModuleInfo);
exit(AzureOpenAIImpl.IsEnabled(CopilotCapability, Silent, CallerModuleInfo));
if not NavApp.GetModuleInfo(AppId, AppModuleInfo) then
exit(false);
exit(AzureOpenAIImpl.IsEnabled(CopilotCapability, Silent, AppModuleInfo));
end;

/// <summary>
Expand Down

0 comments on commit 36e8cf1

Please sign in to comment.