beagle r4619 - trunk/beagle/BeagleClient



Author: dbera
Date: Thu Mar 20 05:48:36 2008
New Revision: 4619
URL: http://svn.gnome.org/viewvc/beagle?rev=4619&view=rev

Log:
Do not send empty fragments, that completely confuses libbeagle's xml handler.


Modified:
   trunk/beagle/BeagleClient/Snippet.cs

Modified: trunk/beagle/BeagleClient/Snippet.cs
==============================================================================
--- trunk/beagle/BeagleClient/Snippet.cs	(original)
+++ trunk/beagle/BeagleClient/Snippet.cs	Thu Mar 20 05:48:36 2008
@@ -145,12 +145,15 @@
 
 		public void AddMatchFragment (int query_term_index, string text)
 		{
+			text = StringFu.CleanupInvalidXmlCharacters (text);
+			if (String.IsNullOrEmpty (text))
+				return;
+
 			if (Fragments == null)
 				Fragments = new ArrayList (3); // mostly will be 3 fragments
 
 			// Before we send a snippet over the wire, clean up any
 			// characters that would be invalid in XML.
-			text = StringFu.CleanupInvalidXmlCharacters (text);
 			Fragments.Add (new Fragment (query_term_index, text));
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]