Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: type 'Null' is not a subtype of type 'String' when calling getEntityRelationService().findInfoByQuery #27

Open
maksonlee opened this issue Feb 9, 2024 · 0 comments

Comments

@maksonlee
Copy link

Environment

  • ThingsBoard: 3.6.2
  • Dart API: 1.0.8

Description
Got exception when tried to call getEntityRelationService().findInfoByQuery, the root cause is that 'fromName' of response is null, the same query can be executed fine with REST API.

    RelationsSearchParameters parameters = RelationsSearchParameters(rootId: 'bcbca450-c1a8-11ee-9f93-492ffd078c6c', rootType: EntityType.ASSET);
    RelationEntityTypeFilter filter = RelationEntityTypeFilter('Contains', [EntityType.DEVICE]);
    EntityRelationsQuery query = EntityRelationsQuery(parameters: parameters, filters: [filter]);
    List<EntityRelation> relations = await relationService.findInfoByQuery(query);
D:/flutter/bin/cache/dart-sdk/bin/dart.exe --enable-asserts D:\src\dart_test\bin\dart_test.dart
Error: type 'Null' is not a subtype of type 'String'
Stack: #0      new EntityRelationInfo.fromJson (package:thingsboard_client/src/model/relation_models.dart:183:18)
#1      EntityRelationService.findInfoByQuery.<anonymous closure> (package:thingsboard_client/src/service/entity_relation_service.dart:157:57)
#2      MappedListIterable.elementAt (dart:_internal/iterable.dart:425:31)
#3      ListIterator.moveNext (dart:_internal/iterable.dart:354:26)
#4      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#6      new List.of (dart:core-patch/array_patch.dart:39:18)
#7      ListIterable.toList (dart:_internal/iterable.dart:224:7)
#8      EntityRelationService.findInfoByQuery (package:thingsboard_client/src/service/entity_relation_service.dart:157:70)
<asynchronous suspension>
#9      main (file:///D:/src/dart_test/bin/dart_test.dart:13:38)
<asynchronous suspension>

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant