diff --git a/libcore/Directory.vala b/libcore/Directory.vala index ead29eadf..18673fd16 100644 --- a/libcore/Directory.vala +++ b/libcore/Directory.vala @@ -910,12 +910,16 @@ public class Files.Directory : Object { } private void add_and_refresh (Files.File gof, bool is_internal) { - if (gof.info == null) { - critical ("FILE INFO null"); + // Check whether we have FileInfo + if (!gof.ensure_query_info ()) { + critical ("FILE INFO unavailable"); + // Fallback to determining hidden status from file name + gof.is_hidden = gof.basename.has_prefix (".") || gof.basename.has_prefix ("~"); + } else { + // Update properties from FileInfo + gof.update (); } - gof.update (); - if ((!gof.is_hidden || Preferences.get_default ().show_hidden_files)) { file_added (gof, is_internal); } diff --git a/libcore/File.vala b/libcore/File.vala index c53dbcf4a..5aa7a17a5 100644 --- a/libcore/File.vala +++ b/libcore/File.vala @@ -440,7 +440,9 @@ public class Files.File : GLib.Object { } public void update () { - GLib.return_if_fail (info != null); + if (info == null) { + return; + } /* free previously allocated */ clear_info ();