[mousetweaks] Do a NULL check before referencing a cursor
- From: Gerd Kohlberger <gerdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mousetweaks] Do a NULL check before referencing a cursor
- Date: Sat, 5 Feb 2011 21:53:43 +0000 (UTC)
commit bafe186d4e58830bb0c5eccf5560922686bf66d3
Author: Gerd Kohlberger <gerdk src gnome org>
Date: Sat Feb 5 22:53:20 2011 +0100
Do a NULL check before referencing a cursor
src/mt-cursor-manager.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/mt-cursor-manager.c b/src/mt-cursor-manager.c
index ad97350..3d6d8f2 100644
--- a/src/mt-cursor-manager.c
+++ b/src/mt-cursor-manager.c
@@ -279,7 +279,10 @@ mt_cursor_manager_get_current_cursor (MtCursorManager *manager)
{
g_return_val_if_fail (MT_IS_CURSOR_MANAGER (manager), NULL);
- return g_object_ref (manager->priv->current);
+ if (manager->priv->current)
+ return g_object_ref (manager->priv->current);
+
+ return NULL;
}
MtCursor *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]