Skip to content

Commit 772782e

Browse files
committed
Fixed null reference when retreiving invoices
1 parent ab966d5 commit 772782e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Exceptionless.Api/Controllers/Base/ExceptionlessApiController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ protected OkWithHeadersContentResult<T> OkWithLinks<T>(T content, string[] links
194194

195195
protected OkWithResourceLinks<TEntity> OkWithResourceLinks<TEntity>(IEnumerable<TEntity> content, bool hasMore, Func<TEntity, string> pagePropertyAccessor = null, IEnumerable<KeyValuePair<string, IEnumerable<string>>> headers = null, bool isDescending = false) where TEntity : class {
196196
var headersToAdd = new HeaderDictionary();
197-
foreach (var kvp in headers)
198-
headersToAdd.Add(kvp.Key, kvp.Value.ToArray());
197+
if (headers != null) {
198+
foreach (var kvp in headers)
199+
headersToAdd.Add(kvp.Key, kvp.Value.ToArray());
200+
}
199201

200202
return new OkWithResourceLinks<TEntity>(content, hasMore, null, pagePropertyAccessor, headersToAdd, isDescending);
201203
}

0 commit comments

Comments
 (0)