added more null checks

can't use sharedFolders API with just folders parameter