hurshi / dio-http-cache

http cache lib for Flutter dio like RxCache
Apache License 2.0
274 stars 223 forks source link

从缓存获取数据时,baseURL为空,导致报错 #17

Closed kimmy-wang closed 4 years ago

kimmy-wang commented 4 years ago
flutter:
flutter: ╔╣ DioError ║ DioErrorType.DEFAULT
flutter: ║  RangeError (index): Invalid value: Only valid value is 0: 1
flutter: ╚══════════════════════════════════════════════════════════════════════════════════════════
flutter: DioError [DioErrorType.DEFAULT]: RangeError (index): Invalid value: Only valid value is 0: 1
#0      List.[] (dart:core-patch/growable_array.dart:147:60)
#1      RequestOptions.uri (package:dio/src/options.dart:299:29)
#2      DioCacheManager._getPrimaryKeyFromOptions (package:dio_http_cache/src/manager_dio.dart:170:41)
#3      DioCacheManager._pullFromCacheBeforeMaxStale (package:dio_http_cache/src/manager_dio.dart:92:9)
#4      DioCacheManager._onError (package:dio_http_cache/src/manager_dio.dart:64:41)
<asynchronous suspension>
#5      InterceptorsWrapper.onError (package:dio/src/interceptor.dart:125:14)
<asynchronous suspension>
#6      DioMixin._request._errorInterceptorWrapper.<anonymous closure> (package:dio/src/dio.dart:846:40)
<asynchronous suspension>
#7      _rootRunUnary (dart:async/zone.dart:1132:38)
#8      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#9      _FutureListener.handleError (dart:async/future_impl.dart:155:20)
#10     Future._propagateToListeners.handl<…>
flutter: NoSuchMethodError: The getter 'login' was called on null.
Receiver: null