PERF: Avoid running a pointless PG query when theme has no variables. (PR #13342)

When Theme#all_theme_variables returns an empty array, we were running a pointless query in StyleSheet::Manager#uploads_digest.

SELECT "sha1" FROM "theme_fields" INNER JOIN "uploads" ON "uploads"."id" = "theme_fields"."upload_id" WHERE 1=0

GitHub