Don't call a non-set callback.

This commit is contained in:
Henrik Rydgård committed 2013-11-29 12:21:02 +01:00
1 parent 0e34574bd7
commit ca6b5b67d5
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -314,7 +314,7 @@ void Download::SetFailed(int code) {
void Download::Do(std::shared_ptr<Download> self) {
// as long as this is in scope, we won't get destructed.
// yeah this is ugly, I need to think about how life time should be managed for these...
std::shared_ptr<Download> self_ = self;
std::shared_ptr<Download> self_ = self;
resultCode_ = 0;
Url fileUrl(url_);
+3 -1
View File
@@ -102,7 +102,9 @@ public:
callback_ = callback;
}
void RunCallback() {
callback_(*this);
if (callback_) {
callback_(*this);
}
}
private: