mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-21 19:01:16 +00:00
add extra safety check
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@36504 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ab2a9854d9
commit
d36af01836
1 changed files with 3 additions and 2 deletions
|
@ -396,14 +396,15 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
|
||||||
if (NSNotFound != index)
|
if (NSNotFound != index)
|
||||||
{
|
{
|
||||||
EcAlarm *old = [a objectAtIndex: index];
|
EcAlarm *old = [a objectAtIndex: index];
|
||||||
|
int notificationID = [old notificationID];
|
||||||
|
|
||||||
severity = [old perceivedSeverity];
|
severity = [old perceivedSeverity];
|
||||||
if (severity <= alertAlarmThreshold)
|
if (severity <= alertAlarmThreshold && notificationID > 0)
|
||||||
{
|
{
|
||||||
NSDictionary *info;
|
NSDictionary *info;
|
||||||
NSString *key;
|
NSString *key;
|
||||||
|
|
||||||
key = [NSString stringWithFormat: @"%d", [old notificationID]];
|
key = [NSString stringWithFormat: @"%d", notificationID];
|
||||||
|
|
||||||
if (nil != (info = [lastAlertInfo objectForKey: key]))
|
if (nil != (info = [lastAlertInfo objectForKey: key]))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue