diff options
Diffstat (limited to 'chrome/browser/extensions/extension_function.cc')
-rw-r--r-- | chrome/browser/extensions/extension_function.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_function.cc b/chrome/browser/extensions/extension_function.cc index f74fdb9..a846d96 100644 --- a/chrome/browser/extensions/extension_function.cc +++ b/chrome/browser/extensions/extension_function.cc @@ -10,7 +10,7 @@ #include "chrome/browser/extensions/extension_function_dispatcher.h" void AsyncExtensionFunction::SetArgs(const std::string& args) { - DCHECK(!args_); // should only be called once + DCHECK(!args_); // Should only be called once. if (!args.empty()) { JSONReader reader; args_ = reader.JsonToValue(args, false, false); @@ -26,7 +26,9 @@ void AsyncExtensionFunction::SetArgs(const std::string& args) { const std::string AsyncExtensionFunction::GetResult() { std::string json; - JSONWriter::Write(result_.get(), false, &json); + // Some functions might not need to return any results. + if (result_.get()) + JSONWriter::Write(result_.get(), false, &json); return json; } |