Skip to content

Commit c863c9d

Browse files
committed
Fix crash in json_file_check_for_errors with gfortran. Fixes #420
1 parent 5ed217e commit c863c9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/json_file_module.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ subroutine json_file_check_for_errors(me,status_ok,error_msg)
447447
#if defined __GFORTRAN__
448448
character(kind=CK,len=:),allocatable :: tmp !! workaround for gfortran bugs
449449
call me%core%check_for_errors(status_ok,tmp)
450-
error_msg = tmp
450+
if (present(error_msg)) error_msg = tmp
451451
#else
452452
call me%core%check_for_errors(status_ok,error_msg)
453453
#endif

0 commit comments

Comments
 (0)