Update App.tsx

This commit is contained in:
Igor Berlenko 2024-02-22 12:01:59 +08:00 committed by GitHub
parent 4e863e5796
commit 1eaae767dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2952,7 +2952,7 @@ class App extends React.Component<AppProps, AppState> {
this.setState({ errorMessage: t("errors.imageToolNotSupported") }); this.setState({ errorMessage: t("errors.imageToolNotSupported") });
return; return;
} }
for (const file of event.clipboardData.files) { for (const file of event.clipboardData?.files ?? []) {
const imageElement = this.createImageElement({ sceneX, sceneY }); const imageElement = this.createImageElement({ sceneX, sceneY });
this.insertImageElement(imageElement, file); this.insertImageElement(imageElement, file);
this.initializeImageDimensions(imageElement); this.initializeImageDimensions(imageElement);