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

ALSO I get all errors I try to download a file #7

Open
LuizSandora opened this issue Jun 18, 2021 · 4 comments
Open

ALSO I get all errors I try to download a file #7

LuizSandora opened this issue Jun 18, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@LuizSandora
Copy link

Hi, Foxite.
I'm having a problem downloading, similar to a previous one that was solved by you,
Every time I run the program it shows the following error:

System.NullReferenceException: Object reference not set to an instance of an object.
at void PatreonDownloader.Program.DownloadMedia(HttpClient client, CookieContainer cookies, List posts) in /mnt/data/Development/PatreonDownloader/PatreonDownloader/Program.cs:line 166
at void PatreonDownloader.Program.Main(string[] args) in /mnt/data/Development/PatreonDownloader/PatreonDownloader/Program.cs:line 104

I even downloaded Chrome (which I particularly hate) but nothing worked.
I don't know how to proceed, I'm quite a layman with all this, sorry.
Could you please help me?

@Foxite
Copy link
Owner

Foxite commented Jun 18, 2021

This is pretty mysterious.

The error is traced back to line 166 of Program.cs, which has this in it:

DirectoryInfo directory = null;

There should be absolutely no way for that line to throw an exception, but I've seen weirder stack traces. I suspect the line numbers are muddled up by the fact that the compiler optimized away some of the code, unless I compile the program in debug mode. Fortunately, function names are always correct, aside from the ones that get removed entirely.

What this means is that the exception could have been literally anywhere in the DownloadMedia function, at or below line 166. I'll give the code a good read once more, and see if there's any obvious problems.

[Slightly unrelated, but I did find one glaring logic error already, which I fixed. It couldn't have caused an error of this type, though.]

@Foxite Foxite added the bug Something isn't working label Jun 18, 2021
@Foxite
Copy link
Owner

Foxite commented Jun 18, 2021

One question. Did this error happen right away, or does it successfully download some posts?

@LuizSandora
Copy link
Author

I do everything correctly, it generates posts.json, and when I open the downloader again, it generates the error immediately after I ask to run the .json. He doesn't download any posts.

@Foxite
Copy link
Owner

Foxite commented Jun 27, 2021

Hi, sorry for the delay.

Please try it again with this build:
PatreonDownloader.zip

It contains debug information which should provide accurate, full stack traces. The error message will be much more useful with this build.

Future releases will contain this debugging information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants