-
Notifications
You must be signed in to change notification settings - Fork 56
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
zilla crash while using model-json and schema is not found #889
Conversation
if (provider != null) | ||
{ | ||
in.wrap(buffer, index, length); | ||
provider.createReader(in).readValue(); | ||
} | ||
else | ||
{ | ||
status = false; | ||
} |
There was a problem hiding this comment.
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.
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(); | |
} |
if (provider != null) | ||
{ | ||
parser.next(); | ||
parser = provider.createParser(in); | ||
while (parser.hasNext()) | ||
{ | ||
parser.next(); | ||
} | ||
} | ||
else | ||
{ | ||
status = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); | |
} |
Fixes #817