Apply the De Morgan's laws!

 if (!(folder == nil || uid == nil))

=>

if (folder && uid)

Much more readable...