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

Unified Diff: chrome/common/extensions/docs/server2/docs_server_utils.py

Issue 1151283007: Docserver overhaul: Gitiles away from me. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-nits Created 5 years, 7 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
Index: chrome/common/extensions/docs/server2/docs_server_utils.py
diff --git a/chrome/common/extensions/docs/server2/docs_server_utils.py b/chrome/common/extensions/docs/server2/docs_server_utils.py
index 7fe962e7a977121920ca381408bb7ee76fde59d9..6acea0270cc494504c0ce28afcc903ce3bb56b30 100644
--- a/chrome/common/extensions/docs/server2/docs_server_utils.py
+++ b/chrome/common/extensions/docs/server2/docs_server_utils.py
@@ -54,7 +54,11 @@ def MarkFirstAndLast(dicts):
def ToUnicode(data):
'''Returns the str |data| as a unicode object. It's expected to be utf8, but
there are also latin-1 encodings in there for some reason. Fall back to that.
+
+ Returns None if given None.
not at google - send to devlin 2015/06/04 22:40:45 I would prefer if call sites checked for this. sen
Ken Rockot(use gerrit already) 2015/06/05 00:21:50 Upon further inspection the bug which was causing
'''
+ if data is None:
+ return None
try:
return unicode(data, 'utf-8')
except:

Powered by Google App Engine
This is Rietveld 408576698