MalloyDelacroix / DownloaderForReddit

The Downloader for Reddit is a GUI application with some advanced features to extract and download submitted content from reddit.
GNU General Public License v3.0
498 stars 47 forks source link

Crash when starting download on a subreddit #307

Closed Wundark closed 1 year ago

Wundark commented 1 year ago

Describe the bug Starting a download on a user works correctly. But when starting a download on a subreddit, the program crashes

Environment Information

{
    "levelname": "INFO",
    "asctime": "10/02/2022 12:14:30 AM",
    "filename": "downloader_for_reddit_gui.py",
    "module": "downloader_for_reddit_gui",
    "name": "DownloaderForReddit.DownloaderForReddit.gui.downloader_for_reddit_gui",
    "funcName": "run",
    "lineno": 635,
    "message": "Download thread started"
}
{
    "levelname": "CRITICAL",
    "asctime": "10/02/2022 12:14:30 AM",
    "filename": "main.py",
    "module": "main",
    "name": "DownloaderForReddit.__main__",
    "funcName": "log_unhandled_exception",
    "lineno": 48,
    "message": "Unhandled exception",
    "exc_info": "Traceback (most recent call last):\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 182, in run\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 230, in run_download\n  File \"DownloaderForReddit\\core\\runner.py\", line 12, in check\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 271, in get_reddit_object_submissions\n  File \"DownloaderForReddit\\core\\runner.py\", line 12, in check\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 295, in get_subreddit_submissions\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 298, in handle_submissions\n  File \"DownloaderForReddit\\core\\runner.py\", line 12, in check\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 322, in get_submissions\n  File \"DownloaderForReddit\\core\\download_runner.py\", line 346, in get_raw_submissions\nAttributeError: 'NoneType' object has no attribute 'value'"
}

Note: All issues marked with the Information Needed label will be closed after 30 days if no information is provided.

MalloyDelacroix commented 1 year ago

The log is indicating that the subreddit does not have a post sort method. This is set to a default value when a new subreddit is added, so it shouldn't be possible for it not to have one.

Have you edited the database directly with another program? When you open the settings for the subreddit, what value is displayed next to "Sort Posts By:"?

Wundark commented 1 year ago

Thanks, that was the problem. I just made sure that a "Sort Posts" was set for each. I had some issues with crashing in the past and I think these values didn't get saved to the database.