Skip to content

Commit

Permalink
fix nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
forsthug committed Sep 30, 2024
1 parent 4960059 commit 8327a69
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public async Task<List<DailyClosingReceipt>> GetAsync()
? await GetQueueItemOfMissingIdAsync(aj).ConfigureAwait(false)
: await _queueItemRepository.GetAsync(aj.ftQueueItemId).ConfigureAwait(false);

var closingNumber = JsonConvert.DeserializeAnonymousType(aj.DataJson, new JObject()).Property("closingNumber")?.Value.Value<long?>();
long? closingNumber = null;
if (aj.DataJson != null && aj.DataJson.Contains("closingNumber"))
{
closingNumber = JsonConvert.DeserializeAnonymousType(aj.DataJson, new JObject()).Property("closingNumber")?.Value.Value<long?>();
}
if(closingNumber == null)
{
var response = JsonConvert.DeserializeObject<ReceiptResponse>(queueItem.response);
Expand Down
2 changes: 1 addition & 1 deletion queue/src/fiskaltrust.Middleware.Queue.EF/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.63",
"version": "1.3.64",
"releaseBranches": [
"^refs/tags/queue/ef/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.63",
"version": "1.3.64",
"releaseBranches": [
"^refs/tags/queue/inmemory/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
2 changes: 1 addition & 1 deletion queue/src/fiskaltrust.Middleware.Queue.MySQL/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.63",
"version": "1.3.64",
"releaseBranches": [
"^refs/tags/queue/mysql/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.63",
"version": "1.3.64",
"releaseBranches": [
"^refs/tags/queue/postgresql/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
2 changes: 1 addition & 1 deletion queue/src/fiskaltrust.Middleware.Queue.SQLite/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.63",
"version": "1.3.64",
"releaseBranches": [
"^refs/tags/queue/sqlite/v\\d+(?:\\.\\d+)*(?:-.*)?$"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
Expand Down Expand Up @@ -159,6 +160,10 @@ public async Task<ftQueueItem> GetClosestPreviousReceiptReferencesAsync(ftQueueI
{
await connection.OpenAsync().ConfigureAwait(false);
var entry = await connection.QueryFirstOrDefaultAsync<ftQueueItem>(query, new { ftQueueItem.ftQueueRow, receiptRequest.cbPreviousReceiptReference }).ConfigureAwait(false);
if (entry == null)
{
return null;
}
var request = JsonConvert.DeserializeObject<ReceiptRequest>(entry.request);
if (request.IncludeInReferences())
{
Expand Down

0 comments on commit 8327a69

Please sign in to comment.