Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed|libdeng2: Looking up a member without throwing an exception
  • Loading branch information
skyjake committed Dec 7, 2012
1 parent 81e2290 commit c8885ac
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions doomsday/libdeng2/src/data/record.cpp
Expand Up @@ -83,12 +83,8 @@ struct Record::Instance
{
String subName = name.substr(0, pos);
String remaining = name.substr(pos + 1);
if(members.find(subName) != members.end())
{
// If it has a RecordValue then we can descend into it.
return &self.value<RecordValue>(subName).dereference()[remaining];
}
return &self.subrecord(subName)[remaining];
// If it is a subrecord we can descend into it.
return self[subName].value<RecordValue>().dereference().d->findMemberByPath(remaining);
}

Members::const_iterator found = members.find(name);
Expand Down

0 comments on commit c8885ac

Please sign in to comment.