fixed potential crash when SendCommand returns NULL