Skip to content

Commit

Permalink
Avoid JSON decode error in case of empty $Objects in /Helpers/SelectO…
Browse files Browse the repository at this point in the history
…wnerDropdown

The error is like: malformed JSON string...
  • Loading branch information
sunnavy committed Apr 25, 2024
1 parent a5b80f5 commit b5f8c1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion share/html/Helpers/SelectOwnerDropdown
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
% $m->abort;
<%INIT>
my @objects;
for my $item ( @{ JSON::from_json($Objects) || [] } ) {
for my $item ( @{ ( $Objects && JSON::from_json($Objects) ) || [] } ) {
my ( $class, $id ) = split /-/, $item, 2;
if ( $class && $id && $class =~ /^RT::(?:Ticket|Queue)/ ) {
my $object = $class->new( $session{CurrentUser} );
Expand Down

0 comments on commit b5f8c1a

Please sign in to comment.