Skip to content

Commit

Permalink
Replace expression with DOC_VALID
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Feb 20, 2024
1 parent b1ff99c commit 9312764
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pinner.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ pin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
(void)pdata;

GeanyDocument* doc = document_get_current();
if (!(doc && doc->is_valid))
if (!DOC_VALID(doc))
return;

// See https://github.com/geany/geany/pull/3770 for more info on
// Why this check is necessary even after checking if doc == NULL
if (doc->file_name == NULL)
Expand Down Expand Up @@ -246,7 +245,7 @@ unpin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
gchar* ptr_file_name = pdata;

if (!pdata) {
if (!(doc && doc->is_valid))
if (!DOC_VALID(doc))
return;

if (doc->file_name == NULL)
Expand Down

0 comments on commit 9312764

Please sign in to comment.