Skip to content

Commit 82752ed

Browse files
committed
Fix for empty lang.Text
1 parent f8fbc4d commit 82752ed

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/AasxPackageLogic/EmptyListVisitor.cs

+21-21
Original file line numberDiff line numberDiff line change
@@ -903,14 +903,14 @@ public override IClass TransformLangStringDefinitionTypeIec61360(ILangStringDefi
903903
{
904904
if (that != null)
905905
{
906-
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
906+
if (!string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
907907
{
908-
that = null;
908+
that.Text = "EMPTY";
909909
}
910-
911-
if (string.IsNullOrEmpty(that.Text))
910+
911+
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
912912
{
913-
that.Text = "EMPTY";
913+
that = null;
914914
}
915915
}
916916
return that;
@@ -920,14 +920,14 @@ public override IClass TransformLangStringNameType(ILangStringNameType that)
920920
{
921921
if(that != null)
922922
{
923-
if(string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
923+
if (!string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
924924
{
925-
that = null;
925+
that.Text = "EMPTY";
926926
}
927927

928-
if (string.IsNullOrEmpty(that.Text))
928+
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
929929
{
930-
that.Text = "EMPTY";
930+
that = null;
931931
}
932932
}
933933
return that;
@@ -937,14 +937,14 @@ public override IClass TransformLangStringPreferredNameTypeIec61360(ILangStringP
937937
{
938938
if (that != null)
939939
{
940-
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
940+
if (!string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
941941
{
942-
that = null;
942+
that.Text = "EMPTY";
943943
}
944944

945-
if (string.IsNullOrEmpty(that.Text))
945+
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
946946
{
947-
that.Text = "EMPTY";
947+
that = null;
948948
}
949949
}
950950
return that;
@@ -954,14 +954,14 @@ public override IClass TransformLangStringShortNameTypeIec61360(ILangStringShort
954954
{
955955
if (that != null)
956956
{
957-
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
957+
if (!string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
958958
{
959-
that = null;
959+
that.Text = "EMPTY";
960960
}
961961

962-
if (string.IsNullOrEmpty(that.Text))
962+
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
963963
{
964-
that.Text = "EMPTY";
964+
that = null;
965965
}
966966
}
967967
return that;
@@ -971,14 +971,14 @@ public override IClass TransformLangStringTextType(ILangStringTextType that)
971971
{
972972
if (that != null)
973973
{
974-
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
974+
if (!string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
975975
{
976-
that = null;
976+
that.Text = "EMPTY";
977977
}
978978

979-
if (string.IsNullOrEmpty(that.Text))
979+
if (string.IsNullOrEmpty(that.Language) && string.IsNullOrEmpty(that.Text))
980980
{
981-
that.Text = "EMPTY";
981+
that = null;
982982
}
983983
}
984984
return that;

0 commit comments

Comments
 (0)