function isValid = isResultBlockValid(results)
    % ISRESULTBLOCKVALID Checks whether a result's corresping block is
    % valid
    % If the subsystem containing the block corresponding to
    % the result is deleted, the fxptds.isResultValid and
    % result.getUniqueIdentifier.isValid continue to return
    % true. The FullName of the block inside the deleted
    % substsystem will not contain the built-in/ or deleted/
    % strings (see g1561716).
                
    %  Copyright 2020 The MathWorks, Inc.
    
    if iscell(results)
        results = [results{:}];
    end
    
    isValid = true(1, numel(results));
    for idx = 1:numel(results)
        result = results(idx);
        
        try
            % getHighestLevelParent will attempt to get the SID of the
            % block which would error out if the block is deleted
            highestParent = result.getHighestLevelParent;
            % highestParent would be empty if the UniqueIdentifer is empty
            if isempty(highestParent)
                isValid(idx) = false;
            end
        catch
            isValid(idx) = false;
        end
    end
    
end