blam r582 - trunk/src
- From: cmartin svn gnome org
- To: svn-commits-list gnome org
- Subject: blam r582 - trunk/src
- Date: Wed, 4 Jun 2008 14:15:38 +0000 (UTC)
Author: cmartin
Date: Wed Jun 4 14:15:38 2008
New Revision: 582
URL: http://svn.gnome.org/viewvc/blam?rev=582&view=rev
Log:
Don't crash if there is no content or summary found in an entry.
Modified:
trunk/src/Item.cs
Modified: trunk/src/Item.cs
==============================================================================
--- trunk/src/Item.cs (original)
+++ trunk/src/Item.cs Wed Jun 4 14:15:38 2008
@@ -84,7 +84,14 @@
* is no content, otherwise use HTML if it's available.
*/
if (entry.Content == null || entry.Content.Length == 0) {
- this.Text = entry.Summary.Text.Trim();
+ System.Console.WriteLine("no content, title= {0}", this.Title);
+ if(entry.Summary.Text == null){
+ System.Console.WriteLine("summary text null");
+ this.Text = "<p>There was no summary/content found for this entry. This is" +
+ " most likely a bug.</p>";
+ } else {
+ this.Text = entry.Summary.Text.Trim();
+ }
} else {
foreach (AtomText content in entry.Content) {
if (content.Type == "text/html" ||
@@ -148,7 +155,12 @@
string entryText = "";
if (entry.Content == null || entry.Content.Length == 0) {
- entryText = entry.Summary.Text.Trim();
+ if(entry.Summary.Text == null){
+ entryText = "<p>There was no summary/content found for this entry. This is" +
+ " most likely a bug.</p>";
+ } else {
+ entryText = entry.Summary.Text.Trim();
+ }
} else {
AtomText text = entry.ContentByType("text/html");
if(text != null){
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]