[longomatch] Fix exception in the players sorting function
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix exception in the players sorting function
- Date: Mon, 1 Dec 2014 09:43:54 +0000 (UTC)
commit e42f87360c27dd081b4f7a256bf80a3a5033ee14
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Dec 1 10:43:23 2014 +0100
Fix exception in the players sorting function
LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
index dbc496e..37ce3d7 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
@@ -50,6 +50,14 @@ namespace LongoMatch.Gui.Component
oa = model.GetValue(a, 0);
ob = model.GetValue(b, 0);
+ if (oa == null && ob == null) {
+ return 0;
+ } else if (oa == null) {
+ return -1;
+ } else if (ob == null) {
+ return 1;
+ }
+
if(oa is Player)
return (oa as Player).Number.CompareTo((ob as Player).Number);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]