diff --git a/frontend/src/app/util/clipboard.js b/frontend/src/app/util/clipboard.js index 0322829e41..742183d0cb 100644 --- a/frontend/src/app/util/clipboard.js +++ b/frontend/src/app/util/clipboard.js @@ -135,7 +135,7 @@ function sortItems(a, b) { export async function fromNavigator(options) { options = options || {}; const items = await navigator.clipboard.read(); - return Promise.all( + const result = await Promise.all( Array.from(items).map(async (item) => { const itemAllowedTypes = Array.from(item.types) .filter(filterAllowedTypes(options)) @@ -155,9 +155,15 @@ export async function fromNavigator(options) { } const type = itemAllowedTypes.at(0); + + if (type == null) { + return null; + } + return item.getType(type); }), ); + return result.filter((item) => !!item); } /**