diff --git a/gnome-panel/panel-multiscreen.c b/gnome-panel/panel-multiscreen.c
index 8a05221..4848f55 100644
--- a/gnome-panel/panel-multiscreen.c
+++ b/gnome-panel/panel-multiscreen.c
@@ -238,9 +238,15 @@ panel_multiscreen_get_raw_monitors_for_screen (GdkScreen     *screen,
 					       int           *monitors_ret,
 					       GdkRectangle **geometries_ret)
 {
-	if (panel_multiscreen_get_randr_monitors_for_screen (screen,
-							     monitors_ret,
-							     geometries_ret))
+	gboolean res;
+
+	*monitors_ret = 0;
+	*geometries_ret = NULL;
+
+	res = panel_multiscreen_get_randr_monitors_for_screen (screen,
+							       monitors_ret,
+							       geometries_ret);
+	if (res && *monitors_ret > 0)
 		return;
 
 	panel_multiscreen_get_gdk_monitors_for_screen (screen,
