-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix: Prevent NPE with autoUpload=false and multiple files are being uploaded #919
Conversation
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.
Looks good, just added some random thoughts.
.anyMatch(index -> { | ||
final String KEY = "uploading"; | ||
JsonObject object = files.getObject(index); | ||
return object.hasKey(KEY) && object.getBoolean(KEY); |
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.
The construct here is a bit unfortunate, but it seems that there is no way to ask Flow to return an optional or a default value? If we need to do this more often, we might want to introduce a helper for that.
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.
It is a valid concern, but JsonObject
is not part of Flow and it does not provide an API using Optional.
Assert.assertEquals("No errors", element.getText()); | ||
} | ||
|
||
private WebElement getButton(UploadElement upload, String buttonType) { |
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.
Had to see this visually to understand that it queries a button from a nested vaadin-upload-file
element. Maybe the method name should reflect that it queries a button within an upload-file element, e.g. getUploadFileElementButton
.
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.
Method was renamed
ee04d6a
to
a38d927
Compare
aad854a
to
a337434
Compare
SonarQube analysis reported 18 issues Top 10 issues
|
Hi @tulioag , this commit cannot be picked to 19.0 by this bot, can you take a look and pick it manually? |
Hi @tulioag , this commit cannot be picked to 14.7 by this bot, can you take a look and pick it manually? |
Hi @tulioag , this commit cannot be picked to 14.6 by this bot, can you take a look and pick it manually? |
Hi @tulioag , this commit cannot be picked to 14.5 by this bot, can you take a look and pick it manually? |
…ploaded (#953) Fixes: vaadin/vaadin-upload#358 cherry-pick: #919 Co-authored-by: Tulio Garcia <28783969+tulioag@users.noreply.github.com>
Fixes: vaadin/vaadin-upload#358