Eyal leshem
Eyal leshem

Reputation: 1115

lua - check if userdata is nil

I trying to use lua cjson to parse to following json :

 {
       "data" : null,
         "message" : "Your session has expired. Please login again.",
           "code" : "390112",
             "success" : false
 }

it's parsed to the following map :

{ ["message"] = Your session has expired. Please login again.,["success"] = false,["data"] = userdata: (nil),["code"] = 390112,}

and i trying to to do something like:

if decoded["data"] == nil or decoded["data"] ==userdata(nil)  then
  return 
end

is that possible?

(userdata(nil) is not valid expression )

Upvotes: 0

Views: 105

Answers (0)

Related Questions