Closed bordalix closed 1 year ago
I think bug was introduced here https://github.com/vulpemventures/marina/pull/417
We never release to the stores tho. You were using marina from master or latest in store?
I think bug was introduced here #417
We never release to the stores tho. You were using marina from master or latest in store?
From master. Yeah, confirm #417
uACK, indeed was introduced with PR 417
App is calling marina importTemplate like this:
On marina is received by provider, which adds an undefined field to array (
changeTemplate
)https://github.com/vulpemventures/marina/blob/e91d805c50bc14a8f9ba70511d85f1d7221a5cc8/src/inject/marina/provider.ts#L45-L47
So, params has a length of 2 when the function
importTemplate
is called. A wrong validation of params[1] on line 493 calledvalidateContract
with an undefined contract, which generated a throw.https://github.com/vulpemventures/marina/blob/e08df1c73c53461d94b6434f286766c00c9e6636/src/content/marina/marinaBroker.ts#L485-L499
Changing line 493 to
if (params[1])
fixed it.The big question is: how did this ever worked? @tiero @louisinger