ID:2840215
 
Resolved
rgb2num() did not allow null to be used as a color, even though that may be returned by atom.color.
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 107.0
Applies to:Dream Daemon
Status: Resolved (515.1597)

This issue has been resolved.
Descriptive Problem Summary:

rgb2num(null) crashes with runtime error: bad color. This is incovenient because atom color can be null and even assigning "#ffffff" to it explicitly turns it into null.

Numbered Steps to Reproduce Problem:
1.) Call rgb2num(null)

Code Snippet (if applicable) to Reproduce Problem:
proc/whatever()
world.log << json_encode(rgb2num(null))


Expected Results:
Prints [255, 255, 255]

Actual Results:
runtime error: bad color

Does the problem occur:
Every time? Or how often?every time
In other games?N/A
In other user accounts?N/A
On other computers?N/A

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
rgb2num(color || "#ffffff")
Lummox JR resolved issue with message:
rgb2num() did not allow null to be used as a color, even though that may be returned by atom.color.