Skip to content

Commit eae1904

Browse files
committed
fix: #148
1 parent 24ccdc7 commit eae1904

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dialogy/plugins/text/duckling_plugin/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def _reshape(
793793
duration_cast_operator=duration_cast_operator,
794794
constraints=self.constraints,
795795
)
796-
if entity.value:
796+
if entity and entity.value:
797797
entity.add_parser(self)
798798
deserialized_entities.append(entity)
799799
return deserialized_entities

dialogy/types/entity/time/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -270,5 +270,11 @@ def from_duckling(
270270
values=datetime_values,
271271
grain=grain,
272272
)
273+
274+
try:
275+
time_entity.collect_datetime_values()
276+
except ValueError:
277+
return None
278+
273279
time_entity.set_entity_type()
274280
return time_entity

0 commit comments

Comments
 (0)