function signalLine = getSignalLine(~, blockPath, portIndex)
%% GetSignalLine is a utility function which returns signal handle given a  blockPath and portIndex

% Copyright 2018-2019 The MathWorks, Inc.
    
    signalLine = [];
    
    % On attempting to get signal information of an invalid blockpath
    % causes hard error which needs to be notified in FPT
    try
        % Select the line whose source has to be traced 
        portHandles = get_param(blockPath, 'PortHandles'); 
        signalLine = get_param(portHandles.Outport(str2double(portIndex)), 'Line'); 
    catch err
        fxptui.showdialog('', err);
    end
end
