Skip to content

Commit

Permalink
Fix potential NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDorier committed Jan 21, 2022
1 parent b96763e commit 89ada4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions NBXplorer/ExplorerBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,14 @@ private async Task IndexBlockLoop(Node node, CancellationToken cancellationToken
downloaded++;
if (downloaded % 5 == 0)
{
CurrentLocation = Chain.GetLocator(block.Header.GetHash());
CurrentLocation = Chain.GetLocator(block.Header.GetHash()) ?? CurrentLocation;
await Repository.SetIndexProgress(CurrentLocation);
}
lastBlock = block;
}
if (lastBlock != null)
{
CurrentLocation = Chain.GetLocator(lastBlock.Header.GetHash());
CurrentLocation = Chain.GetLocator(lastBlock.Header.GetHash()) ?? CurrentLocation;
await Repository.SetIndexProgress(CurrentLocation);
}
if (CurrentLocation.Blocks.Count > 0 && CurrentLocation.Blocks[0] == Chain.TipBlock.Hash)
Expand Down
2 changes: 1 addition & 1 deletion NBXplorer/NBXplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">net6.0</TargetFramework>
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">$(TargetFrameworkOverride)</TargetFramework>
<Version>2.2.19</Version>
<Version>2.2.20</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\NBXplorer.xml</DocumentationFile>
<NoWarn>1701;1702;1705;1591;CS1591</NoWarn>
<LangVersion>10.0</LangVersion>
Expand Down

0 comments on commit 89ada4a

Please sign in to comment.