Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit fcddb73

Browse files
committed
more null check
1 parent 7364c05 commit fcddb73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ApiService/ApiService/onefuzzlib/ReproOperations.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,16 @@ public async Task<OneFuzzResultVoid> BuildReproScript(Repro repro) {
258258
var files = new Dictionary<string, string>();
259259
var auth = await _context.SecretsOperations.GetSecretValue(repro.Auth);
260260

261+
if (auth == null) {
262+
return OneFuzzResultVoid.Error(ErrorCode.VM_CREATE_FAILED, "unable to fetch auth secret");
263+
}
264+
261265
switch (task.Os) {
262266
case Os.Windows:
263267
var sshPath = "$env:ProgramData/ssh/administrators_authorized_keys";
264268
var cmds = new List<string>()
265269
{
266-
$"Set-Content -Path {sshPath} -Value \"{auth?.PublicKey}\"",
270+
$"Set-Content -Path {sshPath} -Value \"{auth.PublicKey}\"",
267271
". C:\\onefuzz\\tools\\win64\\onefuzz.ps1",
268272
"Set-SetSSHACL",
269273
$"while (1) {{ cdb -server tcp:port=1337 -c \"g\" setup\\{task.Config.Task.TargetExe} {report?.InputBlob?.Name} }}"

0 commit comments

Comments
 (0)