hi juan,
in the event can you try to print the if the resource attribute is null or not , like if the attribute is filersrc then try to insert code as
if(null != wdcontext.currentcontextelement().getfilesrc)
{
wdcomponentapi.getmessagemanager().reportsucess("File exists");
}
is your applciation is running in SAP NetWeaver Business Client (NWBC).
Regards
Govardan Raj