FogBugz » TimeIntervalCommentsPlugin http://fogbugz.stackexchange.com/questions/3316
Clone URL:  
Pushed to one repository · View In Graph Contained in version_0-2-0-0, version_0-2-0-1, and tip

more null checking?

Changeset 2441e8b27b94

Parent 3286058dee83

by Adam Wishneusky

Changes to 2 files · Browse files at 2441e8b27b94 Showing diff from parent 3286058dee83 Diff from another changeset...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
 
42
43
 using System.Reflection;  using System.Runtime.CompilerServices;  using System.Runtime.InteropServices;    using FogCreek.Plugins;    // General Information about an assembly is controlled through the following  // set of attributes. Change these attribute values to modify the information  // associated with an assembly.  [assembly: AssemblyFogCreekPluginId("Adam+TimeIntervalExample@fogcreek.com")]  [assembly: AssemblyFogCreekMajorVersion(3)]  [assembly: AssemblyFogCreekMinorVersionMin(6)]  [assembly: AssemblyFogCreekEmailAddress("customer-service@fogcreek.com")]  [assembly: AssemblyFogCreekWebsite("http://www.fogcreek.com/FogBugz/support.html")]  [assembly: AssemblyTitle("TimeIntervalExample")]  [assembly: AssemblyDescription("")]  [assembly: AssemblyConfiguration("")]  [assembly: AssemblyCompany("Fog Creek Software")]  [assembly: AssemblyProduct("TimeIntervalExample")]  [assembly: AssemblyCopyright("Copyright © Fog Creek Software 2011")]  [assembly: AssemblyTrademark("")]  [assembly: AssemblyCulture("")]    // Setting ComVisible to false makes the types in this assembly not visible  // to COM components. If you need to access a type in this assembly from  // COM, set the ComVisible attribute to true on that type.  [assembly: ComVisible(false)]    // The following GUID is for the ID of the typelib if this project is exposed to COM  [assembly: Guid("37dd7a8b-0034-48c8-9922-243ff0a76880")]    // Version information for an assembly consists of the following four values:  //  // Major Version  // Minor Version  // Build Number  // Revision  //  // You can specify all the values or you can default the Build and Revision Numbers  // by using the '*' as shown below:  // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.2.0")] -[assembly: AssemblyFileVersion("0.1.2.0")] +[assembly: AssemblyVersion("0.1.2.1")] +[assembly: AssemblyFileVersion("0.1.2.1")]
 
18
19
20
21
 
22
23
24
 
163
164
165
166
 
 
 
 
 
167
168
169
 
18
19
20
 
21
22
23
24
 
163
164
165
 
166
167
168
169
170
171
172
173
@@ -18,7 +18,7 @@
  {   public TimeIntervalExample(CPluginApi api) : base(api) { }   - protected const string SPluginId = "Adam+TimeIntervalExample@fogcreek.com"; + protected const string sPluginId = "Adam+TimeIntervalExample@fogcreek.com";   private const string CommentsTable = "TimeIntervalComment";   private const string IntervalColumn = "ixInterval";   private const string CommentColumn = "sComment"; @@ -163,7 +163,11 @@
    CTimeInterval[] rgTimeIntervals = query.List();   if (rgTimeIntervals.Length > 0) - sComment = rgTimeIntervals[0].GetPluginField(SPluginId, "sComment").ToString(); + { + object oComment = rgTimeIntervals[0].GetPluginField(sPluginId, "sComment"); + if (oComment != null) + sComment = oComment.ToString(); + }   return sComment;   }   }