diff --git a/modules/gui/src/scene_win/scene_win_model.cc b/modules/gui/src/scene_win/scene_win_model.cc
index 4fc10d492230d54f86d6b08657955615172f399e..2acc15eb393a8abc7b55669caf08faa1b5235572 100644
--- a/modules/gui/src/scene_win/scene_win_model.cc
+++ b/modules/gui/src/scene_win/scene_win_model.cc
@@ -114,6 +114,9 @@ void SceneWinModel::Update()
 QModelIndex SceneWinModel::index(int row, int col, 
                                  const QModelIndex& parent) const
 {
+  if (!hasIndex(row, col, parent)){
+    return QModelIndex();
+  }
   SceneNode* parent_node = GetItem(parent);
 
   if (parent_node->children().size() <= row)