drivers: stepper: shell: fix null pointer check

This commit introduces null pointer check in print_callback

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
Jilay Pandya 2024-11-05 21:11:02 +01:00 committed by Anas Nashif
parent 195c2c1360
commit 1e142b0001
1 changed files with 3 additions and 0 deletions

View File

@ -44,6 +44,9 @@ static void print_callback(const struct device *dev, const enum stepper_event ev
void *user_data)
{
const struct shell *sh = user_data;
if (!sh) {
return;
}
switch (event) {
case STEPPER_EVENT_STEPS_COMPLETED: