Closed ghost closed 6 years ago
Thanks for the report. Can you share the specific bank definition that triggered the crash?
Error is:
...Data\Roaming\REAPER\Scripts\Reaticulate\\app\lib\rtk.lua:36: attempt to index a nil value (local 's')
For example, instead:
//! c=textured i=fall o=cc:32,101
101 fall
you put this for color:
//! c=fall i=fall o=cc:32,101
101 fall
fall is non existent color in your array I suppose.
Yep, makes sense. Cheers.
https://github.com/jtackaberry/reaticulate/blob/master/app/articons.lua#L32
return articons.icons[name] || 'undefined'
Or even you can include undefined icon in your png, so when you handle undefined you should represent icon with question mark for example.
articons.get()
should return nil for an unknown icon name. Also that'd be unrelated to the color, but it's possible they both aren't as robust as they should be.
This is supposed to be handled here: https://github.com/jtackaberry/reaticulate/blob/master/app/reabank.lua#L225
Specifically:
local color = art.color or reabank.colors.default
-- [...]
art.icon = articons.get(art.iconname or 'note-eighth')
So you can see the intention there. Should be quite an easy fix, really, but I won't be in front of my DAW until tonight.
Something like:
art.icon = articons.get(art.iconname) or articons.get('note-eighth')
should do.
At first blush, though, not sure why you're seeing problems with the color. Will dig in tonight.
Scratch that: yes, it's obvious why specifying an invalid color horks. Easy fix there too.
Hi,
For example, while I'm creating new bank presets and I put some undefined icon, color descriptions, plugin will crash if you reload it.
I would suggest something like (pseudo):
if color.exists? ? parse(color) : 'undefined color'
That way we'll have just "undefined : undefined" on GUI, but we'll avoid crash.