Safe check for app before trying to get resources.
Added theme tests.