Skip to content

Conversation

@mrnugget
Copy link
Contributor

This fixes #382 by fixing a regression that was introduced by #361.

When the search queries defined in a campaign spec yielded a repository
match result and file match results in the same repository, in that
order, the code would crash because of an uninitialized map.

The code here fixes it by always initializing the map.

I also added a test that reproduces the behaviour and documents how we
turn multiple search results into a list of repositories.

This fixes #382 by fixing a regression that was introduced by #361.

When the search queries defined in a campaign spec yielded a repository
match result and file match results in the same repository, in that
order, the code would crash because of an uninitialized map.

The code here fixes it by always initializing the map.

I also added a test that reproduces the behaviour and documents how we
turn multiple search results into a list of repositories.
Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@mrnugget mrnugget merged commit 364a0e1 into main Nov 17, 2020
@mrnugget mrnugget deleted the mrn/fix-uninitialized-map branch November 17, 2020 12:13
Copy link

@chrispine chrispine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

scjohns pushed a commit that referenced this pull request Apr 24, 2023
This fixes #382 by fixing a regression that was introduced by #361.

When the search queries defined in a campaign spec yielded a repository
match result and file match results in the same repository, in that
order, the code would crash because of an uninitialized map.

The code here fixes it by always initializing the map.

I also added a test that reproduces the behaviour and documents how we
turn multiple search results into a list of repositories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

campaigns preview panics while resolving repositories

4 participants