Error case handling

Added an 'if' statement to handle the case of there being no matching apps.