[longomatch] Handle more invalid links
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Handle more invalid links
- Date: Fri, 17 Apr 2015 16:25:31 +0000 (UTC)
commit 8dfea76097a088a93a91e3498872f450a4ada413
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Apr 14 13:02:01 2015 +0200
Handle more invalid links
.../CanvasObjects/Dashboard/CategoryObject.cs | 6 +-----
LongoMatch.Drawing/Widgets/DashboardCanvas.cs | 5 +++--
2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch.Drawing/CanvasObjects/Dashboard/CategoryObject.cs
b/LongoMatch.Drawing/CanvasObjects/Dashboard/CategoryObject.cs
index 60ef846..fa4513b 100644
--- a/LongoMatch.Drawing/CanvasObjects/Dashboard/CategoryObject.cs
+++ b/LongoMatch.Drawing/CanvasObjects/Dashboard/CategoryObject.cs
@@ -319,11 +319,7 @@ namespace LongoMatch.Drawing.CanvasObjects.Dashboard
if (sourceTags == null || sourceTags.Count == 0) {
return base.GetAnchor (sourceTags);
} else {
- if (subcatAnchors.ContainsKey (sourceTags [0])) {
- return subcatAnchors [sourceTags [0]];
- } else {
- return null;
- }
+ return subcatAnchors [sourceTags [0]];
}
}
diff --git a/LongoMatch.Drawing/Widgets/DashboardCanvas.cs b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
index 0be75a2..73ea73a 100644
--- a/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
+++ b/LongoMatch.Drawing/Widgets/DashboardCanvas.cs
@@ -421,8 +421,9 @@ namespace LongoMatch.Drawing.Widgets
ActionLinkObject linkObject;
sourceAnchor = buttonObject.GetAnchor (link.SourceTags);
- destAnchor = buttonsDict [link.DestinationButton].GetAnchor
(link.DestinationTags);
- if (destAnchor == null) {
+ try {
+ destAnchor = buttonsDict [link.DestinationButton].GetAnchor
(link.DestinationTags);
+ } catch {
Log.Error ("Skipping link with invalid destination tags");
continue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]