Return value from outer function using Promise

onFileLoaded = function(r) {
    getData(r).then(function(data){
        // do stuff with data
        // if there's a problem:
        if (problem) {
            return false
        }
    });
}

I need to return false from the onFileLoaded function but the validation happens inside then. How do I manage this?