Browse Source

fix: ymodem,当handler为NULL时,打印的内容无法区分是谁为NULL. 但也不会死机.

Wendal Chen 4 months ago
parent
commit
4b1b1fbd77
1 changed files with 6 additions and 1 deletions
  1. 6 1
      components/ymodem/luat_lib_ymodem.c

+ 6 - 1
components/ymodem/luat_lib_ymodem.c

@@ -124,7 +124,12 @@ static int l_ymodem_receive(lua_State *L){
 	}
 	else
 	{
-		LLOGE("%x,%x", handler, handler->ctrl);
+		if (handler == NULL) {
+			LLOGE("handler is nil!!!");
+		}
+		else {
+			LLOGE("handler->ctrl is nil!!!");
+		}
 		lua_pushboolean(L, 0);
 		lua_pushnil(L);
 		lua_pushnil(L);