Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check org, name for null before package resolution when resolving dependencies in Ballerina.toml #42697

Merged

Conversation

gayaldassanayake
Copy link
Contributor

Purpose

When there is an invalid entry like,

[[dependency]]
org = "ballerina"
name1 = "data.jsondata"
version = "0.1.0"
repository = "local"

the toml validator adds error diagnostics. However, since we are proceeding to the CompileTask without failing, we get a bad sad error when accessing the name field.

This fix will check if org, name are not null before accessing the dependencies. The version is already validated when casting to SemanticVersion class.

Fixes #42472

Approach

Describe how you are implementing the solutions along with the design details.

Samples

Provide high-level details about the samples related to this feature.

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

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.

[Bug]: Compiler crash when dependency name is not defined in Ballerina.toml
2 participants