File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -402,18 +402,13 @@ public override object GetValue(int ordinal)
402402 var type = GetColumnType ( ordinal ) ;
403403 var ydbValue = CurrentRow [ ordinal ] ;
404404
405- if ( type . IsNull ( ) )
405+ if ( ydbValue . IsNull ( ) )
406406 {
407407 return DBNull . Value ;
408408 }
409409
410410 if ( type . IsOptional ( ) )
411411 {
412- if ( ydbValue . IsNull ( ) )
413- {
414- return DBNull . Value ;
415- }
416-
417412 type = type . OptionalType . Item ;
418413 }
419414
@@ -578,16 +573,10 @@ private Type UnwrapColumnType(int ordinal)
578573 {
579574 var type = GetColumnType ( ordinal ) ;
580575
581- if ( type . IsNull ( ) )
582- throw new InvalidCastException ( "Field is null." ) ;
583-
584- if ( ! type . IsOptional ( ) )
585- return type ;
586-
587576 if ( CurrentRow [ ordinal ] . IsNull ( ) )
588577 throw new InvalidCastException ( "Field is null." ) ;
589578
590- return type . OptionalType . Item ;
579+ return type . IsOptional ( ) ? type . OptionalType . Item : type ;
591580 }
592581
593582 private Type GetColumnType ( int ordinal ) => ReaderMetadata . GetColumn ( ordinal ) . Type ;
You can’t perform that action at this time.
0 commit comments