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

Unified Diff: Source/devtools/front_end/source_frame/ImageView.js

Issue 672573002: DevTools: _base64ToSize doesn't check content param for null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: return type annotation Created 6 years, 2 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: Source/devtools/front_end/source_frame/ImageView.js
diff --git a/Source/devtools/front_end/source_frame/ImageView.js b/Source/devtools/front_end/source_frame/ImageView.js
index fb1e2ab38dd17e8434d5c06fbe82f8a1763895b5..dfb93533fd31495003192bcdd73476a507b12d19 100644
--- a/Source/devtools/front_end/source_frame/ImageView.js
+++ b/Source/devtools/front_end/source_frame/ImageView.js
@@ -93,9 +93,13 @@ WebInspector.ImageView.prototype = {
this._imagePreviewElement = imagePreviewElement;
},
+ /**
+ * @param {?string} content
+ * @return {number}
+ */
_base64ToSize: function(content)
{
- if (!content.length)
+ if (!content || !content.length)
return 0;
var size = (content.length || 0) * 3 / 4;
if (content.length > 0 && content[content.length - 1] === "=")
« 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