Skip to content

Commit 8ffbed7

Browse files
committed
changed error condition in move routine.
1 parent 2f6fe82 commit 8ffbed7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/json_module.f90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ end subroutine destroy_json_file
451451
!
452452
! DESCRIPTION
453453
! Move the json_value pointer from one json_file to another.
454-
! Note: "from" is not destroyed, since we want to preserve the pointers in "to".
454+
! "from" is then nullified, but not destroyed.
455+
! Note: if "from%p" is not associated, then an error is thrown.
455456
!
456457
! AUTHOR
457458
! Jacob Williams : 12/5/2014
@@ -469,7 +470,8 @@ subroutine move_pointer_in_json_file(to,from)
469470
to%p => from%p
470471
nullify(from%p)
471472
else
472-
nullify(to%p) !in this case, just nullify it
473+
call throw_exception('Error in move_pointer_in_json_file: '//&
474+
'pointer is not associated.')
473475
end if
474476

475477
end subroutine move_pointer_in_json_file

0 commit comments

Comments
 (0)