GCC 12 caught an issue in state_id_by_topic where we were checking a pointer for NULL instead of the contents of the pointer for '\0'. ASTERISK-30044 Change-Id: Ia0b04d4fff45c92acb7f07132a33622fa341148e