ioExtension can of course be NULL...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20579 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2007-04-05 13:33:07 +00:00
parent 0663933acc
commit df004988d8

View File

@ -659,7 +659,10 @@ BTranslatorRoster::Private::Identify(BPositionIO* source,
_RescanChanged();
TranslatorMap::const_iterator iterator = fTranslators.begin();
BMessage baseExtension(*ioExtension);
BMessage baseExtension;
if (ioExtension != NULL)
baseExtension = *ioExtension;
float bestWeight = 0.0f;
while (iterator != fTranslators.end()) {
@ -679,7 +682,8 @@ BTranslatorRoster::Private::Identify(BPositionIO* source,
if (translator.Identify(source, format, &extension, &info, wantType) == B_OK) {
float weight = info.quality * info.capability;
if (weight > bestWeight) {
*ioExtension = extension;
if (ioExtension != NULL)
*ioExtension = extension;
bestWeight = weight;
info.translator = iterator->first;