Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If the queue inflator from #2798 encounters an error while inflating a netkan, an exception is thrown while trying to process the error:
(That
Object reference not set to an instance of an object
line shouldn't be there. The rest are fine.)Cause
If inflation fails, we don't have a
ckan
object, so we pass null tosendCkan
:CKAN/Netkan/Processors/QueueHandler.cs
Line 80 in d47a5b7
CKAN/Netkan/Processors/QueueHandler.cs
Line 101 in d47a5b7
This is passed to
Program.CkanFileName
:CKAN/Netkan/Processors/QueueHandler.cs
Line 142 in d47a5b7
... which assumes it can't be null:
CKAN/Netkan/Program.cs
Lines 167 to 177 in d47a5b7
The NRE would be thrown when we try to access
.Identifier
or.Version
.Changes
Now the
FileName
outgoing queue attribute is optional, only sent when theckan
parameter is non-null, because without it we don't know what the filename should be.Fixes #2865.