From ef8a8f9fc5dd258f9a87b1cd71d16cea23f29ad8 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 13 Jan 2021 19:04:45 +0100 Subject: [PATCH] [MIRROR] Fixes null-named painting issue (#2683) * Fixes null-named painting issue (#56113) There was an issue where you could name paintings nothing, which would cause issues with persistency. This was because the stripped_input didn't actually check that you put something in, so the PR adds that check. It now ensures, both when saved and loaded, that there is a title. If not, it sets them to the default 'Untitled Artwork' * Fixes null-named painting issue Co-authored-by: Coffee --- code/game/objects/structures/artstuff.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index efbb98cf2bb..0cfcf2cef11 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -323,6 +323,8 @@ var/title = chosen["title"] var/author = chosen["ckey"] var/png = "data/paintings/[persistence_id]/[chosen["md5"]].png" + if(!title) + title = "Untitled Artwork" //Should prevent NULL named art from loading as NULL, if you're still getting the admin log chances are persistence is broken if(!title) message_admins("Painting with NO TITLE loaded on a [persistence_id] frame in [get_area(src)]. Please delete it, it is saved in the database with no name and will create bad assets.") if(!fexists(png)) @@ -353,7 +355,7 @@ stack_trace("Invalid persistence_id - [persistence_id]") return if(!C.painting_name) - return + C.painting_name = "Untitled Artwork" var/data = C.get_data_string() var/md5 = md5(lowertext(data)) var/list/current = SSpersistence.paintings[persistence_id]