mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-04 21:29:21 +00:00
Guard control in the main catch handlers
A start without HOME throws before control is constructed.
This commit is contained in:
+4
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user