TaskClosureAdapter::Run does not invoke the task if it is null.

This is an attempt to fix http://crbug.com/81449. If this actually fixes it then there is probably something more fundamentally wrong.

BUG=81449
Review URL: http://codereview.chromium.org/7563025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95441 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 726cadbe27df6ef057661759bc2bcdfe3f46890e
diff --git a/base/task.cc b/base/task.cc
index 8c61473..a862cac 100644
--- a/base/task.cc
+++ b/base/task.cc
@@ -53,9 +53,11 @@
 }
 
 void TaskClosureAdapter::Run() {
-  task_->Run();
-  delete task_;
-  task_ = NULL;
+  if (task_) {
+    task_->Run();
+    delete task_;
+    task_ = NULL;
+  }
 }
 
 // Don't leak tasks by default.