rspec/rules/S4586/description.adoc

2 lines
199 B
Plaintext
Raw Normal View History

2020-12-23 14:59:06 +01:00
Returning ``null`` from a non-``async`` ``Task``/``Task<T>`` method will cause a ``NullReferenceException`` at runtime. This problem can be avoided by returning ``Task.FromResult<T>(null)`` instead.