Fixes #82 crash on startup when no project is previously selected. #93
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.
Fixes #82
This bug was introduced in 8f1e04e by changing
struct RecentProject
toclass ProjectDefinition
. By making this type a reference, the default value is now null, instead of an object with all fields set to default, which leads to crashes when it is dereferenced.This fix makes the SetProject() function accept null as an arugment and then configures all variables as they would have been before. This continues to run the intialization code. Alternatively, we could skip the call to SetProject() entirely -- with my limited understanding of the code base, I don't know if that's safe or not. I don't feel strongly about the approach, happy to do either.
#89 also fixes this by skipping the call to SetProject() if project is null, but I think it makes sense to decouple this quick bug fix from the rest of the feature work there.