Check for NULL.

This commit is contained in:
Steve Checkoway
2006-02-10 09:41:42 +00:00
parent 3f199dbf2a
commit 5c5655b137
+1 -1
View File
@@ -30,7 +30,7 @@ inline void PrintIOErr( IOReturn err, const char *s )
inline Boolean IntValue( CFTypeRef o, int &n ) inline Boolean IntValue( CFTypeRef o, int &n )
{ {
if( CFGetTypeID(o) != CFNumberGetTypeID() ) if( !o || CFGetTypeID(o) != CFNumberGetTypeID() )
return false; return false;
return CFNumberGetValue( CFNumberRef(o), kCFNumberIntType, &n ); return CFNumberGetValue( CFNumberRef(o), kCFNumberIntType, &n );
} }