Skip to content

zilla crash while using model-json and schema is not found#889

Merged
jfallows merged 2 commits intoaklivity:developfrom
ankitk-me:modelBugFix
Apr 4, 2024
Merged

zilla crash while using model-json and schema is not found#889
jfallows merged 2 commits intoaklivity:developfrom
ankitk-me:modelBugFix

Conversation

@ankitk-me
Copy link
Contributor

Fixes #817

Comment on lines +79 to +87
if (provider != null)
{
in.wrap(buffer, index, length);
provider.createReader(in).readValue();
}
else
{
status = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to avoid using else clauses to assign boolean variables like this.

Instead, aim to take an approach that would also work for multiple conditions discovered incrementally.

Suggested change
if (provider != null)
{
in.wrap(buffer, index, length);
provider.createReader(in).readValue();
}
else
{
status = false;
}
status &= provider != null;
if (status)
{
in.wrap(buffer, index, length);
provider.createReader(in).readValue();
}

Comment on lines +78 to +88
if (provider != null)
{
parser.next();
parser = provider.createParser(in);
while (parser.hasNext())
{
parser.next();
}
}
else
{
status = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (provider != null)
{
parser.next();
parser = provider.createParser(in);
while (parser.hasNext())
{
parser.next();
}
}
else
{
status = false;
status &= provider != null;
if (status)
{
in.wrap(buffer, index, length);
provider.createReader(in).readValue();
}

@jfallows jfallows merged commit e34c809 into aklivity:develop Apr 4, 2024
@ankitk-me ankitk-me deleted the modelBugFix branch April 28, 2025 04:16
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.

Error in JsonValidatorHandler when the remote registry can't be accessed

2 participants