From 8873f75aed6e360a613ceac44139de4844b707f3 Mon Sep 17 00:00:00 2001 From: Grace Hawkins Date: Wed, 14 Jul 2021 05:09:34 +0430 Subject: [PATCH] Fix check condition bug of field index in hive generator --- hive_generator/lib/src/type_adapter_generator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hive_generator/lib/src/type_adapter_generator.dart b/hive_generator/lib/src/type_adapter_generator.dart index 704128ad8..5e3c0d97a 100644 --- a/hive_generator/lib/src/type_adapter_generator.dart +++ b/hive_generator/lib/src/type_adapter_generator.dart @@ -136,7 +136,7 @@ class TypeAdapterGenerator extends GeneratorForAnnotation { void verifyFieldIndices(List fields) { for (var field in fields) { - check(field.index >= 0 || field.index <= 255, + check(field.index >= 0 && field.index <= 255, 'Field numbers can only be in the range 0-255.'); for (var otherField in fields) {