Simplifying delegate invoke

Ref: 0074790684 (r37477529)
This commit is contained in:
rockstardev 2020-02-25 16:08:57 -06:00
parent fec5637040
commit 5a93857b4a

View File

@ -196,14 +196,8 @@ namespace BTCPayServer.Services.Rates
throw new APIException(text);
}
api.ProcessResponse(new InternalHttpWebResponse(webHttpResponse));
// local reference to handle delegate becoming null, extended discussion here:
// https://github.com/btcpayserver/btcpayserver/commit/00747906849f093712c3907c99404c55b3defa66#r37022103
var requestStateChanged = RequestStateChanged;
if (requestStateChanged != null)
{
requestStateChanged(this, RequestMakerState.Finished, text);
return text;
}
RequestStateChanged?.Invoke(this, RequestMakerState.Finished, text);
return text;
}
catch (Exception arg)