mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-09 04:58:27 -06:00
Import: don't assume an empty file is a text file
Since in any case, the empty file has nothing to import and it's admitted by
SQLite as a valid database, it's better to revert to the previous behaviour,
where an empty file dropped or opened by the file manager was treated as a DB
and indeed worked.
The behaviour was changed by cfa4dee3be
See issue #2636
This commit is contained in:
@@ -65,7 +65,7 @@ bool isTextOnlyFile(const QString& fileName)
|
||||
QFile file(fileName);
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QByteArray data = file.read(512);
|
||||
return isTextOnly(data);
|
||||
return !data.isEmpty() && isTextOnly(data);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user