redbean: return early from LuaWSWrite if upgrade fails

This commit is contained in:
Derek Meer 2025-03-19 13:54:02 -07:00
parent 4a10293f84
commit a0429ccf05

View file

@ -5342,13 +5342,16 @@ close:
}
static int LuaWSWrite(lua_State *L) {
int type;
int type, retval;
size_t size;
const char *data;
OnlyCallDuringRequest(L, "ws.Write");
if (!cpm.wstype) {
LuaWSUpgrade(L);
retval = LuaWSUpgrade(L);
if (retval != 0) {
return retval;
}
}
type = luaL_optinteger(L, 2, -1);