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

Unified Diff: net/base/net_util.cc

Issue 419: Fix a crash caused by a NULL FILETIME when creating ftp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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 | net/base/net_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
===================================================================
--- net/base/net_util.cc (revision 1680)
+++ net/base/net_util.cc (working copy)
@@ -819,9 +819,13 @@
result.append(",");
- Time time(Time::FromFileTime(*modified));
- string_escape::JavascriptDoubleQuote(base::TimeFormatShortDateAndTime(time),
- true, &result);
+ std::wstring modified_str;
+ // |modified| can be NULL in FTP listings.
+ if (modified) {
+ Time time(Time::FromFileTime(*modified));
+ modified_str = base::TimeFormatShortDateAndTime(time);
+ }
+ string_escape::JavascriptDoubleQuote(modified_str, true, &result);
brettw 2008/09/03 18:48:48 Can all the code be moved inside the if statement?
result.append(");</script>\n");
« no previous file with comments | « no previous file | net/base/net_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698