summaryrefslogtreecommitdiffstats
path: root/quantum/painter/qp_comms.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/painter/qp_comms.c')
-rw-r--r--quantum/painter/qp_comms.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/quantum/painter/qp_comms.c b/quantum/painter/qp_comms.c
index bcc6de8f2e..63667783e1 100644
--- a/quantum/painter/qp_comms.c
+++ b/quantum/painter/qp_comms.c
@@ -8,7 +8,7 @@
bool qp_comms_init(painter_device_t device) {
painter_driver_t *driver = (painter_driver_t *)device;
- if (!driver->validate_ok) {
+ if (!driver || !driver->validate_ok) {
qp_dprintf("qp_comms_init: fail (validation_ok == false)\n");
return false;
}
@@ -18,7 +18,7 @@ bool qp_comms_init(painter_device_t device) {
bool qp_comms_start(painter_device_t device) {
painter_driver_t *driver = (painter_driver_t *)device;
- if (!driver->validate_ok) {
+ if (!driver || !driver->validate_ok) {
qp_dprintf("qp_comms_start: fail (validation_ok == false)\n");
return false;
}
@@ -28,7 +28,7 @@ bool qp_comms_start(painter_device_t device) {
void qp_comms_stop(painter_device_t device) {
painter_driver_t *driver = (painter_driver_t *)device;
- if (!driver->validate_ok) {
+ if (!driver || !driver->validate_ok) {
qp_dprintf("qp_comms_stop: fail (validation_ok == false)\n");
return;
}
@@ -38,7 +38,7 @@ void qp_comms_stop(painter_device_t device) {
uint32_t qp_comms_send(painter_device_t device, const void *data, uint32_t byte_count) {
painter_driver_t *driver = (painter_driver_t *)device;
- if (!driver->validate_ok) {
+ if (!driver || !driver->validate_ok) {
qp_dprintf("qp_comms_send: fail (validation_ok == false)\n");
return false;
}