Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NullOnEmptyConverterFactory : Converter.Factory() {
- override fun responseBodyConverter(type: Type?, annotations: Array<Annotation>?, retrofit: Retrofit?): Converter<ResponseBody, *>? {
- val delegate = retrofit!!.nextResponseBodyConverter<Any>(this, type!!, annotations!!)
- return Converter<ResponseBody, Any> {
- if (it.contentLength() == 0L) return@Converter ResponseSuccess(true, "", null)
- delegate.convert(it)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement