File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public ContextItem(Contract contract)
4444
4545            public  ContextItem ( JObject  json ) 
4646            { 
47-                 this . Script  =  Convert . FromBase64String ( json [ "script" ] . AsString ( ) ) ; 
47+                 this . Script  =  json [ "script" ]   is   JToken . Null   ?   null   :   Convert . FromBase64String ( json [ "script" ] . AsString ( ) ) ; 
4848                this . Parameters  =  ( ( JArray ) json [ "parameters" ] ) . Select ( p =>  ContractParameter . FromJson ( ( JObject ) p ) ) . ToArray ( ) ; 
4949                this . Signatures  =  ( ( JObject ) json [ "signatures" ] ) . Properties . Select ( p =>  new 
5050                { 
@@ -56,7 +56,7 @@ public ContextItem(JObject json)
5656            public  JObject  ToJson ( ) 
5757            { 
5858                JObject  json  =  new ( ) ; 
59-                 json [ "script" ]  =  Convert . ToBase64String ( Script ) ; 
59+                 json [ "script" ]  =  Script   ==   null   ?   null   :   Convert . ToBase64String ( Script ) ; 
6060                json [ "parameters" ]  =  new  JArray ( Parameters . Select ( p =>  p . ToJson ( ) ) ) ; 
6161                json [ "signatures" ]  =  new  JObject ( ) ; 
6262                foreach  ( var  signature  in  Signatures ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments