Not very keen on this.  If det_ctx->sgh == NULL, the effort is a waste.