I'm not convinced this is the right way to fix this function.  If log_name doesn't get set in the switch, we probably don't want to call SummarizeTransaction() at all.  So adding a default: label to case PROMISE_RESULT_WARN: (which returns prematurely) may be a better solution.  Given that every value of the enum PromiseResult is in fact covered by the switch, this default could be considered redundant: what brought this code to your attention ?