Skip to content

Commit

Permalink
Fixes #3902 : allow double click in image picker
Browse files Browse the repository at this point in the history
Steps to reproduce the behavior:

1. Open any document in Nextcloud Office
2. Insert -> Insert Image... (it shows NC file picker)
3. Double click on any entry (or even anywhere in the dialog?)
4. Click button 'Insert Image'

Result: no image inserted, in the browser console we can see error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'path')

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
  • Loading branch information
eszkadev authored and backportbot[bot] committed Aug 19, 2024
1 parent 81c16af commit b14cd63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/view/FilesAppIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export default {
.addButton({
label: t('richdocuments', 'Insert image'),
callback: (files) => {
insertFileFromPath(files[0].path)
if (files && files.length) {
insertFileFromPath(files[0].path)
}
},
})
.build()
Expand Down

0 comments on commit b14cd63

Please sign in to comment.