Skip to content

Commit

Permalink
fix device groups with null criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
franzmueller committed Oct 14, 2024
1 parent b9e896f commit cf4e11d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 24 deletions.
4 changes: 2 additions & 2 deletions lib/models/device_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DeviceGroup {
@Index(caseSensitive: false)
String name;
String image;
List<DeviceGroupCriteria> criteria;
List<DeviceGroupCriteria>? criteria;
List<String> device_ids;
List<Attribute>? attributes;
String? auto_generated_by_device;
Expand Down Expand Up @@ -133,7 +133,7 @@ class DeviceGroup {
return;
}
states.clear();
for (final criterion in criteria) {
for (final criterion in criteria ?? []) {
final f = AppState().nestedFunctions[criterion.function_id];
if (f == null) {
_logger.e("Function is unknown: ${criterion.function_id}");
Expand Down
63 changes: 42 additions & 21 deletions lib/models/device_group.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.0.319+319
version: 0.0.320+320


environment:
Expand Down

0 comments on commit cf4e11d

Please sign in to comment.