Don't try to open files by empty paths.
This commit is contained in:
parent
6b320a99da
commit
5938cb012f
1 changed files with 3 additions and 0 deletions
|
|
@ -418,6 +418,9 @@ std::array<QImage, 4> PrepareCorners(
|
||||||
|
|
||||||
ReadResult Read(ReadArgs &&args) {
|
ReadResult Read(ReadArgs &&args) {
|
||||||
if (args.content.isEmpty()) {
|
if (args.content.isEmpty()) {
|
||||||
|
if (args.path.isEmpty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
auto file = QFile(args.path);
|
auto file = QFile(args.path);
|
||||||
if (file.size() > kReadBytesLimit
|
if (file.size() > kReadBytesLimit
|
||||||
|| !file.open(QIODevice::ReadOnly)) {
|
|| !file.open(QIODevice::ReadOnly)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue