Merge pull request #892 from docker/fix_log_stream_end

Avoid nil pointer when reading logs of a just terminated container.
This commit is contained in:
Guillaume Tardif 2020-11-10 14:06:51 +01:00 committed by GitHub
commit 1cc0ccb189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -282,6 +282,9 @@ func getACIContainerLogs(ctx context.Context, aciContext store.AciContext, conta
if err != nil { if err != nil {
return "", fmt.Errorf("cannot get container logs: %v", err) return "", fmt.Errorf("cannot get container logs: %v", err)
} }
if logs.Content == nil {
return "", nil
}
return *logs.Content, err return *logs.Content, err
} }