Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaticulate is crashed if icon description or color description is wrong #13

Closed
ghost opened this issue Nov 29, 2017 · 7 comments
Closed
Labels

Comments

@ghost
Copy link

ghost commented Nov 29, 2017

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.

@jtackaberry
Copy link
Owner

Thanks for the report. Can you share the specific bank definition that triggered the crash?

@ghost
Copy link
Author

ghost commented Nov 29, 2017

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.

@jtackaberry
Copy link
Owner

Yep, makes sense. Cheers.

@ghost
Copy link
Author

ghost commented Nov 29, 2017

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.

@jtackaberry
Copy link
Owner

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.

@jtackaberry
Copy link
Owner

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.

@jtackaberry
Copy link
Owner

Scratch that: yes, it's obvious why specifying an invalid color horks. Easy fix there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant