aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-08 22:02:08 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-08 22:02:08 +0100
commit0cd3d2c2267298a24c6d0bc3fdc0ffd8ffaf4f39 (patch)
tree8296edc09684c6947e0770a66a115da987f544a5 /src
parent264f7af36ce238d414b27587645d5b8cde0f54a4 (diff)
parent6f549014e542afbfdda6d5311d4837ec8cf0479c (diff)
downloadayatana-indicator-printers-0cd3d2c2267298a24c6d0bc3fdc0ffd8ffaf4f39.tar.gz
ayatana-indicator-printers-0cd3d2c2267298a24c6d0bc3fdc0ffd8ffaf4f39.tar.bz2
ayatana-indicator-printers-0cd3d2c2267298a24c6d0bc3fdc0ffd8ffaf4f39.zip
Merge branch 'fossfreedom-main'
Attributes GH PR #13: https://github.com/AyatanaIndicators/ayatana-indicator-printers/pull/13
Diffstat (limited to 'src')
-rw-r--r--src/indicator-printers-menu.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/indicator-printers-menu.c b/src/indicator-printers-menu.c
index 54ea281..bf0bc07 100644
--- a/src/indicator-printers-menu.c
+++ b/src/indicator-printers-menu.c
@@ -215,10 +215,13 @@ update_all_printer_menuitems (IndicatorPrintersMenu *self)
ndests = cupsGetDests (&dests);
for (i = 0; i < ndests; i++) {
- int state = atoi (cupsGetOption ("printer-state",
- dests[i].num_options,
- dests[i].options));
- update_printer_menuitem (self, dests[i].name, state);
+ const char *option = cupsGetOption ("printer-state",
+ dests[i].num_options,
+ dests[i].options);
+ if (option != NULL) {
+ int state = atoi (option);
+ update_printer_menuitem (self, dests[i].name, state);
+ }
}
cupsFreeDests (ndests, dests);
}