Preset hangs, probably on a getColor statement

In the King Korg preset, there is a formatting function “displayChar”, called by Sysex controls 0-11 (on page 6).

When I uncomment the 3 lines below, sending the preset to the Electra makes both the Google Chrome browser and the Electra One hang.
Current workaround; by commenting the 3 lines and rebooting the PC, I can reload the preset and run the preset again.

 function displayChar (valueObject, value)
    local control = valueObject:getControl ()
    --if value == 32 then control:setColor(RED) 
    --else control:setColor(WHITE)
    --end
   return string.char(value)
 end

PS: I can continue working, so this is not critical

I’ve changed over to V2.1.7 of the firmware and redid this test, but this time on the Korg 03R/W preset Electra One App, which has similar code:

function displayChar (valueObject, value)
  local control = valueObject:getControl ()
  -- control:setName (string.char(value))
  -- if value <= 32 then control:setColor(RED) 
  --   else control:setColor(WHITE)
  --end
  return string.char(value)
end

The issues are still there: when I uncomment the setName or the setColor statements, the preset seems to work fine, until I go to the Name page where those controls are shown:

  • At first look, the controls display what was requested in the displayChar formatting function
  • The hint window however does not disappear anymore
  • The preset hangs.

If I then change anything in the lua code (except re-commenting inside the displayChar function) and run the script again, chances are high that then not only the preset hangs, but also the web editor freezes. Closing Google chrome won’t solve the issue: I need then to restart the PC and the last chances to the preset code are lost as well.