33_readingsGroup.pm: prevent crash on empty reading list if sorting is useed

git-svn-id: https://svn.fhem.de/fhem/trunk@12692 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2016-12-01 14:31:17 +00:00
parent 5fdd5c67bc
commit 5ed0cb194a

View File

@@ -788,7 +788,7 @@ readingsGroup_2html($;$)
@l = sort rgSort @l;
}
$hash->{groupedList} = ();
$hash->{groupedList} = [];
foreach my $n (@l) {
my $cg1 = @{$n}[1]; my $cg2 = @{$n}[2]; my $cg3 = @{$n}[3]; my $cg4 = @{$n}[4];
my @l = @list[1..@list-1];
@@ -797,7 +797,7 @@ readingsGroup_2html($;$)
push @{$hash->{groupedList}}, '<br2>' if( $hash->{groupedList} );
push @{$hash->{groupedList}}, @l;
}
@list = @{$hash->{groupedList}};
@list = @{$hash->{groupedList}} if( $hash->{groupedList} );
}
my $first = 1;