FreeTrainの進化系を目指す
GetContributionでidが見つからないときにnullを返すように
| @@ -593,7 +593,13 @@ | ||
| 593 | 593 | /// Gets the contribution with a given ID, or null if not found. |
| 594 | 594 | /// </summary> |
| 595 | 595 | public Contribution GetContribution( string id ) { |
| 596 | - return contributionMap[id]; | |
| 596 | + Contribution ctb; | |
| 597 | + if(contributionMap.TryGetValue(id, out ctb)){ | |
| 598 | + return ctb; | |
| 599 | + } else { | |
| 600 | + Debug.WriteLine("Contribution not found for the id = "+ id); | |
| 601 | + return null; | |
| 602 | + } | |
| 597 | 603 | } |
| 598 | 604 | |
| 599 | 605 | /// <summary> |