File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -104,14 +104,23 @@ impl ChangeSet {
104
104
. query_row ( [ ] , |row| {
105
105
Ok ( (
106
106
row. get :: < _ , Impl < Descriptor < DescriptorPublicKey > > > ( "descriptor" ) ?,
107
- row. get :: < _ , Impl < Descriptor < DescriptorPublicKey > > > ( "change_descriptor" ) ? ,
107
+ row. get :: < _ , Impl < Descriptor < DescriptorPublicKey > > > ( "change_descriptor" ) ,
108
108
row. get :: < _ , Impl < bitcoin:: Network > > ( "network" ) ?,
109
109
) )
110
110
} )
111
111
. optional ( ) ?;
112
- if let Some ( ( Impl ( desc) , Impl ( change_desc ) , Impl ( network) ) ) = row {
112
+ if let Some ( ( Impl ( desc) , res , Impl ( network) ) ) = row {
113
113
changeset. descriptor = Some ( desc) ;
114
- changeset. change_descriptor = Some ( change_desc) ;
114
+ use crate :: rusqlite:: types:: Type ;
115
+ use crate :: rusqlite:: Error :: * ;
116
+ changeset. change_descriptor = match res {
117
+ Ok ( Impl ( change_desc) ) => Some ( change_desc) ,
118
+ Err ( e) => match e {
119
+ // allow a Null column for change descriptor
120
+ InvalidColumnType ( _, _, Type :: Null ) => None ,
121
+ _ => return Err ( e) ,
122
+ } ,
123
+ } ;
115
124
changeset. network = Some ( network) ;
116
125
}
117
126
You can’t perform that action at this time.
0 commit comments