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 rakshasa
parent 4831a44879
commit b5b37a2e07
+2
View File
@@ -492,6 +492,7 @@ main(int argc, char** argv) {
control->cleanup();
} catch (torrent::internal_error& e) {
if (control != nullptr)
control->cleanup_exception();
std::cout << "rtorrent: caught torrent::internal_error: "
@@ -505,6 +506,7 @@ main(int argc, char** argv) {
return -1;
} catch (std::exception& e) {
if (control != nullptr)
control->cleanup_exception();
std::cout << "rtorrent: caught" << typeid(e).name() << " : " << e.what() << std::endl;