immich/mobile/lib/repositories/api.repository.dart
shenlong 12f7b2a005
chore: add always_put_control_body_on_new_line lint (#28352)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2026-05-11 13:47:24 -04:00

11 lines
274 B
Dart

import 'package:immich_mobile/constants/errors.dart';
abstract class ApiRepository {
Future<T> checkNull<T>(Future<T?> future) async {
final response = await future;
if (response == null) {
throw const NoResponseDtoError();
}
return response;
}
}