mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 07:19:24 +00:00
98_weekprofile: dry fix crash msg407302
git-svn-id: https://svn.fhem.de/fhem/trunk@10829 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d2f3f60c0c
commit
4dd4a2a887
@ -256,7 +256,7 @@ sub weekprofile_sendDevProfile(@)
|
||||
$k++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $ret = undef;
|
||||
if ($cmd) {
|
||||
$cmd =~ s/^\s+|\s+$//g;
|
||||
@ -464,13 +464,15 @@ sub weekprofile_Get($$@)
|
||||
my ($topic, $name) = weekprofile_splitName($params[0]);
|
||||
|
||||
my ($prf,$idx) = weekprofile_findPRF($hash,$name,$topic);
|
||||
return "profile $params[0] not found" unless ($prf);
|
||||
return "profile $params[0] not found" if (!defined($prf));
|
||||
|
||||
if (defined($prf->{REF})) {
|
||||
($topic, $name) = weekprofile_splitName($prf->{REF});
|
||||
($prf,$idx) = weekprofile_findPRF($hash,$name,$topic);
|
||||
}
|
||||
|
||||
return "profile $params[0] has no data" if (!defined($prf->{DATA}));
|
||||
|
||||
my $json = JSON->new;
|
||||
my $json_text = $json->encode($prf->{DATA});
|
||||
return $json_text;
|
||||
|
Loading…
Reference in New Issue
Block a user