blam r546 - trunk/src



Author: cmartin
Date: Sat Apr 19 08:47:08 2008
New Revision: 546
URL: http://svn.gnome.org/viewvc/blam?rev=546&view=rev

Log:
Don't segfault at feed adding when the clipboard is empty.

If the clipboard is empty, the string is set to null and we didn't
check for that.


Modified:
   trunk/src/Dialogs.cs

Modified: trunk/src/Dialogs.cs
==============================================================================
--- trunk/src/Dialogs.cs	(original)
+++ trunk/src/Dialogs.cs	Sat Apr 19 08:47:08 2008
@@ -63,7 +63,7 @@
 
     public static void ClipboardTextReceived(Clipboard clipboard, string text)
     {
-        if((!text.StartsWith("http://";) && !text.StartsWith("https://";)) || text == string.Empty){
+        if(text == null || !text.StartsWith("http://";) || !text.StartsWith("https://";) || text == string.Empty){
             mThis.urlEntry.Text = "";
         } else {
             mThis.urlEntry.InsertText(text);
@@ -72,9 +72,9 @@
 
     public void Show ()
     {
+        mThis = this;
         Clipboard clipboard = Clipboard.Get(Gdk.Atom.Intern("CLIPBOARD", true));
         clipboard.RequestText(ClipboardTextReceived);
-        mThis = this; /* FIXME: This could be a race condition. */
 
 	    usernameEntry.Text = "";
 	    passwordEntry.Text = "";



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