70_Pushover: fix non-JSON support

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9175 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2015-08-30 16:32:36 +00:00
parent 2b64923f54
commit 685a05c3f4

View File

@ -347,10 +347,9 @@ sub Pushover_ReceiveCommand($$$) {
}
# Use JSON module if possible
eval { use JSON };
if ( !$@ ) {
$return = decode_json( Encode::encode_utf8($data) );
}
eval 'use JSON qw( decode_json ); 1';
$return = decode_json( Encode::encode_utf8($data) )
if ( !$@ );
}
else {
if ( !defined($cmd) || ref($cmd) eq "HASH" || $cmd eq "" ) {