mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
99_Utils.pm: return undef,undef, if key was not found (Forum #30528)
git-svn-id: https://svn.fhem.de/fhem/trunk@7364 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c6508c2a5d
commit
6c2165e007
@ -16,7 +16,7 @@ sub
|
||||
getUniqueId()
|
||||
{
|
||||
my ($err, $uniqueID) = getKeyValue("uniqueID");
|
||||
return $uniqueID if(!$err);
|
||||
return $uniqueID if(defined($uniqueID));
|
||||
srand(time);
|
||||
$uniqueID = join "",map { unpack "H*", chr(rand(256)) } 1..16;
|
||||
setKeyValue("uniqueID", $uniqueID);
|
||||
@ -33,7 +33,7 @@ getKeyValue($)
|
||||
for my $l (@l) {
|
||||
return (undef, $1) if($l =~ m/^$key:(.*)/);
|
||||
}
|
||||
return ("Key not found", undef);
|
||||
return (undef, undef);
|
||||
}
|
||||
|
||||
sub
|
||||
@ -404,7 +404,8 @@ myUtils_Initialize($$)
|
||||
|
||||
<li><b>getKeyValue(keyName)</b><br>
|
||||
return ($error, $value), stored previously by setKeyValue.
|
||||
$error is undef if there was no error, otherwise $value is undef.
|
||||
$error is set if there was an error. Both are undef, if there is no
|
||||
value yet for this key.
|
||||
</li></br>
|
||||
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user