RT 5.0.6 Use of uninitialized value

Hi all,
after upgrading from RT 5.0.5 to 5.0.6 I see a lot of this information in the syslog:

Use of uninitialized value $txn_type in pattern match (m//) at /opt/rt506/share/html/Elements/ShowTransaction line 217.
Use of uninitialized value $txn_type in string eq at /opt/rt506/share/html/Elements/ShowTransaction line 230.
Use of uninitialized value $txn_type in string eq at /opt/rt506/share/html/Elements/ShowTransaction line 252.
Use of uninitialized value $type in hash element at /opt/rt506/sbin/../lib/RT/Record.pm line 1801.
Use of uninitialized value in pattern match (m//) at /opt/rt506/share/html/Elements/ShowTransactionAttachments line 137.
Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.32.1/HTML/Scrubber.pm line 223.
Use of uninitialized value in string eq at /opt/rt506/share/html/Elements/ShowHistoryPage line 69.
Use of uninitialized value in string eq at /opt/rt506/share/html/Elements/ShowTransaction line 86.

How can I start troubleshooting?
Thanks

The problem occurs when commenting (not replying) on a ticket.
RT wants to show the email sending operation even when you don’t have permission to see it.
if I give permission “ShowOutgoingEmail” the problem does not arise.
Without permission “ShowOutgoingEmail”:
immagine
With permission “ShowOutgoingEmail”:

Only on comment there is the problem, on Reply if i haven’t the permission i don’t show anything