Skip to content

Commit 1f98bb3

Browse files
mymldengbo11
authored andcommitted
fix: replace Q_ASSERT with proper error handling
导出layer出错时应该报错
1 parent 3b356c6 commit 1f98bb3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/linglong/src/linglong/package/layer_packager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ LayerPackager::pack(const LayerDir &dir, const QString &layerFilePath) const
166166
}
167167

168168
auto result = LayerFile::New(layerFilePath);
169-
Q_ASSERT(result.has_value());
169+
if (!result) {
170+
return LINGLONG_ERR(result);
171+
}
170172

171173
return result;
172174
}

0 commit comments

Comments
 (0)