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 *
|
const BCharacterSet *
|
||||||
BCharacterSetRoster::GetCharacterSetByFontID(uint32 id)
|
BCharacterSetRoster::GetCharacterSetByFontID(uint32 id)
|
||||||
{
|
{
|
||||||
|
if ((id < 0) || (id >= character_sets_by_id_count)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return character_sets_by_id[id];
|
return character_sets_by_id[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
const BCharacterSet *
|
const BCharacterSet *
|
||||||
BCharacterSetRoster::GetCharacterSetByConversionID(uint32 id)
|
BCharacterSetRoster::GetCharacterSetByConversionID(uint32 id)
|
||||||
{
|
{
|
||||||
|
if ((id+1 < 0) || (id+1 >= character_sets_by_id_count)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return character_sets_by_id[id+1];
|
return character_sets_by_id[id+1];
|
||||||
}
|
}
|
||||||
|
|
||||||
const BCharacterSet *
|
const BCharacterSet *
|
||||||
BCharacterSetRoster::GetCharacterSetByMIBenum(uint32 MIBenum)
|
BCharacterSetRoster::GetCharacterSetByMIBenum(uint32 MIBenum)
|
||||||
{
|
{
|
||||||
|
if ((MIBenum < 0) || (MIBenum > maximum_valid_MIBenum)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return character_sets_by_MIBenum[MIBenum];
|
return character_sets_by_MIBenum[MIBenum];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user