summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-08-23 09:45:57 -0700
committerCorey Berla <corey@berla.me>2022-08-31 23:58:07 +0000
commit3163e9a23cfa0fc75a118ed7ec7c99c0e4212a50 (patch)
treea62301b2f15deccf587a175a8875997ca447b745
parent4fcfe1338998c78b6f3e2a4477975b7b8226f9ba (diff)
downloadnautilus-3163e9a23cfa0fc75a118ed7ec7c99c0e4212a50.tar.gz
properties: Don't attempt to setup_star if parent_location == NULL
When you open a properties window on the root file system, you'll get g_file_has_prefix: assertion 'G_IS_FILE (file)' failed because setup_star is checking if the parent location can be starred. We only allow starring files in the home directory anyways, so just return early Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2422
-rw-r--r--src/nautilus-properties-window.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index af8c2d8bb..8c2c21152 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -804,6 +804,11 @@ setup_star_button (NautilusPropertiesWindow *self)
NautilusFile *file = get_target_file (self);
g_autoptr (GFile) parent_location = nautilus_file_get_parent_location (file);
+ if (parent_location == NULL)
+ {
+ return;
+ }
+
if (nautilus_tag_manager_can_star_contents (tag_manager, parent_location))
{
gtk_widget_show (self->star_button);