• R/O
  • SSH
  • HTTPS

tdcgexplorer: Commit


Commit MetaInfo

Revision2269 (tree)
Time2016-09-08 19:24:49
Authornomeu

Log Message

flipnodes.txtで指定したnodeがないなら警告; 例外を避ける

Change Summary

Incremental Difference

--- trunk/tsoview/TDCG.TMOFlip/TMOFlipProcessor.cs (revision 2268)
+++ trunk/tsoview/TDCG.TMOFlip/TMOFlipProcessor.cs (revision 2269)
@@ -33,7 +33,13 @@
3333 {
3434 Debug.Assert(tokens.Length == 2, "tokens length should be 2");
3535 string cnode_name = tokens[1];
36- int cnode_id = nodemap[cnode_name].Id;
36+ TMONode cnode;
37+ if (!nodemap.TryGetValue(cnode_name, out cnode))
38+ {
39+ Console.WriteLine("warn: cnode not found. {0}", cnode_name);
40+ continue;
41+ }
42+ int cnode_id = cnode.Id;
3743
3844 foreach (TMOFrame frame in tmo.frames)
3945 {
@@ -47,8 +53,20 @@
4753 Debug.Assert(tokens.Length == 3, "tokens length should be 3");
4854 string lnode_name = tokens[1];
4955 string rnode_name = tokens[2];
50- int lnode_id = nodemap[lnode_name].Id;
51- int rnode_id = nodemap[rnode_name].Id;
56+ TMONode lnode;
57+ TMONode rnode;
58+ if (!nodemap.TryGetValue(lnode_name, out lnode))
59+ {
60+ Console.WriteLine("warn: lnode not found. {0}", lnode_name);
61+ continue;
62+ }
63+ if (!nodemap.TryGetValue(rnode_name, out rnode))
64+ {
65+ Console.WriteLine("warn: rnode not found. {0}", rnode_name);
66+ continue;
67+ }
68+ int lnode_id = lnode.Id;
69+ int rnode_id = rnode.Id;
5270
5371 foreach (TMOFrame frame in tmo.frames)
5472 {
Show on old repository browser