Skip to content

Commit efa6a5a

Browse files
committed
Add length validation for custom properties in GenerateProxyClass and update MySettingOperation with a long string variable for testing
1 parent b0fe535 commit efa6a5a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/iop/cls/IOP/Utils.cls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ ClassMethod GenerateProxyClass(
300300
Set tDefault = tPropInfo."__getitem__"(2)
301301
If ""'=tDefault {
302302
Set tCustomProp.InitialExpression = $$$quote(tDefault)
303+
if $LENGTH(tDefault)>255 {
304+
Set tSC = tCustomProp.Parameters.SetAt("","MAXLEN")
305+
Quit:$$$ISERR(tSC)
306+
}
303307
}
304308
Set tCustomProp.Required = tPropInfo."__getitem__"(3)
305309

src/tests/registerFilesIop/bo.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class MySettingOperation(BusinessOperation):
139139
my_float_var : float = 0.0
140140
my_untyped_var = 0
141141
my_str_var = "foo"
142+
my_very_long_var = "a" * 1000 # Long string for testing
142143

143144
def OnMessage(self, request):
144145
attr = request.StringValue

0 commit comments

Comments
 (0)