Skip to content

Commit d6cb55e

Browse files
committed
fix crashing unit test by checking offset 0 when reading internetLink and copyright
1 parent 3463ea3 commit d6cb55e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/importexport/tabledit/internal/importtef.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ std::string TablEdit::readUtf8TextIndirect(uint32_t positionOfPosition)
117117
{
118118
_file->seek(positionOfPosition);
119119
uint32_t position = readUInt32();
120-
_file->seek(position);
121-
LOGD("position %d", position);
122-
return readUtf8Text();
120+
if (position) {
121+
_file->seek(position);
122+
LOGD("position %d", position);
123+
return readUtf8Text();
124+
} else {
125+
return "";
126+
}
123127
}
124128

125129
// return the part index for the instrument containing stringIdx

0 commit comments

Comments
 (0)