Don't try to convert NULL into a String.
authorTilman Sauerbeck <tilman@code-monkey.de>
Mon, 23 Aug 2004 18:30:28 +0000 (18:30 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Mon, 23 Aug 2004 18:30:28 +0000 (18:30 +0000)
src/ecore_x/rb_window.c

index 5c688f767c079fa63f669a9fe8cab5c67f5a1340..f5af7c78d9a168fc17db7e565b846624866db2ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_window.c 95 2004-08-23 11:05:15Z tilman $
+ * $Id: rb_window.c 97 2004-08-23 18:30:28Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -272,9 +272,13 @@ static VALUE c_parent_get (VALUE self)
 
 static VALUE c_title_get (VALUE self)
 {
+       char *s;
+
        GET_OBJ (self, RbWindow, win);
 
-       return rb_str_new2 (ecore_x_window_prop_title_get (win->real));
+       s = ecore_x_window_prop_title_get (win->real);
+
+       return s ? rb_str_new2 (s) : Qnil;
 }
 
 static VALUE c_title_set (VALUE self, VALUE val)