diff options
author | shreyasv <shreyasv@chromium.org> | 2015-06-26 15:59:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-26 23:00:57 +0000 |
commit | 4f8c94a1175d6b388037c14f8fbc992146d6e6e9 (patch) | |
tree | 34a9d9d77e657771c2aab7cc1d63f7f7d10c2eae /ios | |
parent | 05704e6d5fd196e86dcf1a4ca30c495a729f5ca1 (diff) | |
download | chromium_src-4f8c94a1175d6b388037c14f8fbc992146d6e6e9.zip chromium_src-4f8c94a1175d6b388037c14f8fbc992146d6e6e9.tar.gz chromium_src-4f8c94a1175d6b388037c14f8fbc992146d6e6e9.tar.bz2 |
Correcting a DCHECK.
The previous DCHECK was wrong since it was checking for |result|.
The base::JSONReader::Read API can return a nullptr base::Value.
Also moved the DCHECK outside the check for |handler| since it should be
verified even when no |handler| is registered.
BUG=503598
Review URL: https://codereview.chromium.org/1212393004
Cr-Commit-Position: refs/heads/master@{#336469}
Diffstat (limited to 'ios')
-rw-r--r-- | ios/web/web_state/ui/crw_web_controller.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 7007edf..f1ad838 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm @@ -1863,10 +1863,10 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; (void (^)(scoped_ptr<base::Value>, NSError*))handler { [self evaluateJavaScript:script stringResultHandler:^(NSString* stringResult, NSError* error) { + DCHECK(stringResult || error); if (handler) { scoped_ptr<base::Value> result( base::JSONReader::Read(base::SysNSStringToUTF8(stringResult))); - DCHECK(result || error); handler(result.Pass(), error); } }]; |