Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm

Issue 2248983003: Avoid failing assert when Physical Web scanner is inactive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm
diff --git a/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm b/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm
index d2762f21837ac2c1557984ea9b6ff633437523a6..41ce75763a7144104d88c660a349203692f862c8 100644
--- a/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm
+++ b/ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.mm
@@ -4,7 +4,6 @@
#import "ios/chrome/common/physical_web/ios_chrome_physical_web_data_source.h"
-#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/values.h"
#import "ios/chrome/common/physical_web/physical_web_scanner.h"
@@ -37,9 +36,10 @@ void IOSChromePhysicalWebDataSource::StopDiscovery() {
}
std::unique_ptr<base::ListValue> IOSChromePhysicalWebDataSource::GetMetadata() {
- std::unique_ptr<base::ListValue> metadata = [scanner_ metadata];
- DCHECK(metadata);
- return metadata;
+ if (!scanner_) {
+ return base::MakeUnique<base::ListValue>();
+ }
+ return [scanner_ metadata];
}
bool IOSChromePhysicalWebDataSource::HasUnresolvedDiscoveries() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698