Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro DeleteAsync #244

Open
CrisRogoy opened this issue Jun 13, 2024 · 1 comment
Open

Erro DeleteAsync #244

CrisRogoy opened this issue Jun 13, 2024 · 1 comment

Comments

@CrisRogoy
Copy link

I'm trying to delete a file or folder and it's giving me the following error
"System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name'"

But this is OK, it's just a test and the variable "oo" IS NOT NULL but it gives the same error.

I'm using version 1.10.4

Here is just a test

        IEnumerable<INode> nodes2 = await MClient.GetNodesFromLinkAsync(new Uri("https://mega.nz/folder/CgwjRapBeyNl10emvGN9H-9tg"));

        ListStatus.Items.Clear();

        INode oo = null;

        foreach (var item in nodes2)
        {
            if (item.Type == NodeType.Directory)
            {
                oo = item;
                break;
            }
        }

        Progress<double> PProgresso = null;
        PProgresso = new Progress<double>(p => ProgressBar.Value = Convert.ToInt32(p));
        PProgresso.ProgressChanged += PProgresso_ProgressChanged;

        await MClient.DownloadFileAsync(oo, $"C:\\TEMP\\{oo.Name}", PProgresso);

        await MClient.DeleteAsync(oo);

        await MClient.LogoutAsync();
@CrisRogoy
Copy link
Author

I'm trying to delete a file or folder and it's giving me the following error "System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name'"

But this is OK, it's just a test and the variable "oo" IS NOT NULL but it gives the same error.

I'm using version 1.10.4

Here is just a test

        IEnumerable<INode> nodes2 = await MClient.GetNodesFromLinkAsync(new Uri("https://mega.nz/folder/CgwjRapBeyNl10emvGN9H-9tg"));

        ListStatus.Items.Clear();

        INode oo = null;

        foreach (var item in nodes2)
        {
            if (item.Type == NodeType.Directory)
            {
                oo = item;
                break;
            }
        }

        Progress<double> PProgresso = null;
        PProgresso = new Progress<double>(p => ProgressBar.Value = Convert.ToInt32(p));
        PProgresso.ProgressChanged += PProgresso_ProgressChanged;

        await MClient.DownloadFileAsync(oo, $"C:\\TEMP\\{oo.Name}", PProgresso);

        await MClient.DeleteAsync(oo);

        await MClient.LogoutAsync();

Estou tentando excluir um arquivo ou pasta e aparece o seguinte erro "System.ArgumentNullException: 'O valor não pode ser nulo. Arg_ParamName_Name'"

Mas tudo bem, é apenas um teste e a variável "oo" IS NOT NULL mas dá o mesmo erro.

Estou usando a versão 1.10.4

Aqui está apenas um teste

        IEnumerable<INode> nodes2 = await MClient.GetNodesFromLinkAsync(new Uri("https://mega.nz/folder/CgwjRapBeyNl10emvGN9H-9tg"));

        ListStatus.Items.Clear();

        INode oo = null;

        foreach (var item in nodes2)
        {
            if (item.Type == NodeType.Directory)
            {
                oo = item;
                break;
            }
        }

        Progress<double> PProgresso = null;
        PProgresso = new Progress<double>(p => ProgressBar.Value = Convert.ToInt32(p));
        PProgresso.ProgressChanged += PProgresso_ProgressChanged;

        await MClient.DownloadFileAsync(oo, $"C:\\TEMP\\{oo.Name}", PProgresso);

        await MClient.DeleteAsync(oo);

        await MClient.LogoutAsync();

I checked here and this part of the code,

await MClient.DeleteAsync(oo);
There is no error if I put it like this:
await MClient.DeleteAsync(oo, false); // that the file does not go to the trash,
However, if I leave it as true it gives an error, is there any configuration in the Client?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant