immich/mobile/lib/infrastructure/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

13 lines
291 B
Dart

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