Fix error when there was no search query for exercises

This commit is contained in:
Roland Geider committed 2021-01-25 13:47:44 +01:00
1 parent 1314c899d0
commit ad672ae269
1 file changed
+4
+4
View File
@@ -151,6 +151,10 @@ class Exercises extends WgerBaseProvider with ChangeNotifier {
/// We could do this locally, but the server has better text searching capabilities
/// with postgresql.
Future<List> searchExercise(String name) async {
if (name.length <= 1) {
return [];
}
// Send the request
final response = await client.get(
makeUrl(_exerciseSearchPath, query: {'term': name}),