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 <[email protected]>
  • Loading branch information
eszkadev authored and backportbot[bot] committed Aug 19, 2024
1 parent 34bc133 commit 154a38d
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 @@ -186,7 +186,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 154a38d

Please sign in to comment.