We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dd926b9 + 2dad2fb commit 3d382c1Copy full SHA for 3d382c1
modules/zip/zip_reader.cpp
@@ -58,7 +58,14 @@ Error ZIPReader::close() {
58
PackedStringArray ZIPReader::get_files() {
59
ERR_FAIL_COND_V_MSG(fa.is_null(), PackedStringArray(), "ZIPReader must be opened before use.");
60
61
- int err = unzGoToFirstFile(uzf);
+ unz_global_info gi;
62
+ int err = unzGetGlobalInfo(uzf, &gi);
63
+ ERR_FAIL_COND_V(err != UNZ_OK, PackedStringArray());
64
+ if (gi.number_entry == 0) {
65
+ return PackedStringArray();
66
+ }
67
+
68
+ err = unzGoToFirstFile(uzf);
69
ERR_FAIL_COND_V(err != UNZ_OK, PackedStringArray());
70
71
List<String> s;
0 commit comments