From 56632b69a766f52de6a289e1d7c8a367c98af757 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 22 Jan 2019 00:22:17 +0100 Subject: osmo_fsm_state_name: make robust against NULL fi Change-Id: I61d4f7dfada2763948f330745ac886405d889a12 --- include/osmocom/core/fsm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/osmocom/core/fsm.h') diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 5bf5328e..df7e3486 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -220,7 +220,7 @@ const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state); /*! return the name of the state the FSM instance is currently in. */ static inline const char *osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi) -{ return osmo_fsm_state_name(fi->fsm, fi->state); } +{ return fi ? osmo_fsm_state_name(fi->fsm, fi->state) : "NULL"; } /*! perform a state change of the given FSM instance * -- cgit v1.2.3