diff options
author | Ondrej Holy <oholy@redhat.com> | 2023-02-02 14:13:35 +0100 |
---|---|---|
committer | Corey Berla <corey@berla.me> | 2023-02-06 19:39:20 +0000 |
commit | fcf8f9de8336549f6395c440a9be983849254b31 (patch) | |
tree | 0177bb122b1fec59f2dab0443f524eca9c386242 | |
parent | 7b77f09872f702dfd09fbc7e5548325dd26ea266 (diff) | |
download | nautilus-fcf8f9de8336549f6395c440a9be983849254b31.tar.gz |
file-operations: Fix inverted g_assert condition
The commit e2969a9c29d0d171038fcb35d8baa5a7df372191 introduced an assertion
statement to ensure that the `g_file_get_basename` returned non-NULL string.
Unfortunately, the assertion has an inverted condition. This leads to crashes
in the `get_unique_target_file` function for files that don't have the
`edit-name` attribute set (i.e just a few GVfs backends). Let's fix the
inverted condition.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2825
-rw-r--r-- | src/nautilus-file-operations.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index bdc05a2a6..9aa6755e3 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -4383,7 +4383,7 @@ get_unique_target_file (GFile *src, if (dest == NULL) { basename = g_file_get_basename (src); - g_assert (basename == NULL); + g_assert (basename != NULL); if (g_utf8_validate (basename, -1, NULL)) { |