diff --git a/src/kits/storage/AppFileInfo.cpp b/src/kits/storage/AppFileInfo.cpp index 4089868f5a..62ae1c7b44 100644 --- a/src/kits/storage/AppFileInfo.cpp +++ b/src/kits/storage/AppFileInfo.cpp @@ -1117,8 +1117,7 @@ BAppFileInfo::_ReadData(const char *name, int32 id, type_code type, else error = B_ERROR; } - - } else + } else if (!foundData) error = B_BAD_VALUE; // return the allocated buffer, or free it on error