mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-07 12:33:36 +09:00
do runtime check instead of assertion
This commit is contained in:
1 parent
60a42421d7
commit
cd6afefa2f
1 file changed
+4
-1
@@ -48,7 +48,10 @@ const toPreviewAssets = (
|
||||
const assets: Array<Promise<PreviewAsset>> = [];
|
||||
for (const formData of formsData) {
|
||||
for (const entry of formData) {
|
||||
const file = entry[1] as File;
|
||||
const file = entry[1];
|
||||
if (!(file instanceof File)) {
|
||||
continue;
|
||||
}
|
||||
const promise: Promise<PreviewAsset> = new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.addEventListener("load", (event) => {
|
||||
|
||||
Reference in new issue
Block a user