error protection for Get functions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4278 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5c78d8ec9e
commit
884d2b83a6
@ -54,18 +54,27 @@ BCharacterSetRoster::StopWatching(BMessenger target)
|
||||
const BCharacterSet *
|
||||
BCharacterSetRoster::GetCharacterSetByFontID(uint32 id)
|
||||
{
|
||||
if ((id < 0) || (id >= character_sets_by_id_count)) {
|
||||
return NULL;
|
||||
}
|
||||
return character_sets_by_id[id];
|
||||
}
|
||||
|
||||
const BCharacterSet *
|
||||
BCharacterSetRoster::GetCharacterSetByConversionID(uint32 id)
|
||||
{
|
||||
if ((id+1 < 0) || (id+1 >= character_sets_by_id_count)) {
|
||||
return NULL;
|
||||
}
|
||||
return character_sets_by_id[id+1];
|
||||
}
|
||||
|
||||
const BCharacterSet *
|
||||
BCharacterSetRoster::GetCharacterSetByMIBenum(uint32 MIBenum)
|
||||
{
|
||||
if ((MIBenum < 0) || (MIBenum > maximum_valid_MIBenum)) {
|
||||
return NULL;
|
||||
}
|
||||
return character_sets_by_MIBenum[MIBenum];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user