scan-app fails if app does not exist

Error message:

Application does not exists! local variable 'res' referenced before assignment