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

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: 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.
'''
+ if data is None:
+ return None
Ken Rockot(use gerrit already) 2015/05/26 00:26:24 I was having a very bad time trying to track down
try:
return unicode(data, 'utf-8')
except:

Powered by Google App Engine
This is Rietveld 408576698