Fixed #17667 -- Prevented app loading from skipping nonexistent apps after the first try

Thanks ea2100@ for the report and akaariai for the patch.