@@ -797,7 +797,11 @@ public string EncodeFileNameUsingJiraStandard(string fileName)
797797
798798 private void CorrectClosedByAndClosedDate ( WiRevision rev , WorkItem wi )
799799 {
800- var wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ?? string . Empty ;
800+ var wiState = string . Empty ;
801+ if ( wi . Fields . ContainsKey ( WiFieldReference . State ) )
802+ {
803+ wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ;
804+ }
801805 var revState = rev . Fields . GetFieldValueOrDefault < string > ( WiFieldReference . State ) ?? string . Empty ;
802806
803807 if (
@@ -827,7 +831,11 @@ private void CorrectClosedByAndClosedDate(WiRevision rev, WorkItem wi)
827831 }
828832 private void CorrectActivatedByAndActivatedDate ( WiRevision rev , WorkItem wi )
829833 {
830- var wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ?? string . Empty ;
834+ var wiState = string . Empty ;
835+ if ( wi . Fields . ContainsKey ( WiFieldReference . State ) )
836+ {
837+ wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ;
838+ }
831839 var revState = rev . Fields . GetFieldValueOrDefault < string > ( WiFieldReference . State ) ?? string . Empty ;
832840
833841 if ( ! wiState . Equals ( New , StringComparison . InvariantCultureIgnoreCase ) && revState . Equals ( New , StringComparison . InvariantCultureIgnoreCase ) )
@@ -848,7 +856,11 @@ private void CorrectActivatedByAndActivatedDate(WiRevision rev, WorkItem wi)
848856
849857 private void CorrectResolvedByAndResolvedDate ( WiRevision rev , WorkItem wi )
850858 {
851- var wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ?? string . Empty ;
859+ var wiState = string . Empty ;
860+ if ( wi . Fields . ContainsKey ( WiFieldReference . State ) )
861+ {
862+ wiState = wi . Fields [ WiFieldReference . State ] . ToString ( ) ;
863+ }
852864 var revState = rev . Fields . GetFieldValueOrDefault < string > ( WiFieldReference . State ) ?? string . Empty ;
853865
854866 if ( ( wiState . Equals ( Resolved , StringComparison . InvariantCultureIgnoreCase )
0 commit comments