Guard control in the main catch handlers

A start without HOME throws before control is constructed.
This commit is contained in:
noctuum
2026-09-24 15:42:01 +05:00
committed by Jari Sundell
parent bb77aa644c
commit 9f6fd7994e
+4 -2
View File
@@ -492,7 +492,8 @@ main(int argc, char** argv) {
control->cleanup();
} catch (torrent::internal_error& e) {
control->cleanup_exception();
if (control != nullptr)
control->cleanup_exception();
std::cout << "rtorrent: caught torrent::internal_error: "
<< e.what() << std::endl
@@ -505,7 +506,8 @@ main(int argc, char** argv) {
return -1;
} catch (std::exception& e) {
control->cleanup_exception();
if (control != nullptr)
control->cleanup_exception();
std::cout << "rtorrent: caught" << typeid(e).name() << " : " << e.what() << std::endl;