79475107

Date: 2025-02-28 09:51:32
Score: 0.5
Natty:
Report link

Got an answer for it.

if (body == null) {
         if (typeOf<T>().isMarkedNullable) {
             Resource.Success(null as T)
         } else {
             Resource.Error("APi responded with success but there is no data Available.")
         }
     }

I could use the isMarkedNullable function to know if the value can be nullable

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: SproutinGeek