Im creating the following process:
- Upload a file to dropbox using the API
- After upload, create a shared link for that file
- If a shared link already exists, get that existing shared link for the user
My Issue:
Im using the following code to check if the shared link already exists:
if(x.error[".tag"] === "shared_link_already_exists"){
//code to get existing shared link here
}
When I upload a new file which has never had a shared link created I get the following error:
TypeError: Cannot read property '.tag' of undefined
How can I get around this?
.taginside as follows!!x.error && x.error[".tag"] === "shared_link_already_exists"]