don't crash when file is empty
This commit is contained in:
parent
920f9bf92e
commit
9981d9bb3d
1 changed files with 4 additions and 0 deletions
|
@ -77,6 +77,10 @@ const send = (file, element) => {
|
|||
gen_RSA_keypair(1024).then(([pub_key, sec_key]) => {
|
||||
element = update(element, "Chiffrement du fichier...", "H3");
|
||||
|
||||
if (content.length == 0) {
|
||||
update(element, "Fichier vide.", "H3");
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
file: RSA_enc(content, sec_key).join(","),
|
||||
filename: RSA_enc(file.name, sec_key).join(","),
|
||||
|
|
Reference in a new issue