diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 3f0b87a00a..5a206186c0 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -351,6 +351,8 @@ wash_obj(AM) /obj/machinery/shower/proc/wash_obj(obj/O) + if(!O) + return . = SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) . = O.clean_blood() O.remove_atom_colour(WASHABLE_COLOUR_PRIORITY) diff --git a/tgui/packages/tgui/interfaces/PaperSheet.js b/tgui/packages/tgui/interfaces/PaperSheet.js index 80e7448366..cf7af0d0d6 100644 --- a/tgui/packages/tgui/interfaces/PaperSheet.js +++ b/tgui/packages/tgui/interfaces/PaperSheet.js @@ -44,8 +44,16 @@ const textWidth = (text, font, fontsize) => { const c = document.createElement('canvas'); const ctx = c.getContext("2d"); ctx.font = font; + if (text) { + const width = ctx.measureText(text).width; + return width; + } else { + return 0; + } + /* const width = ctx.measureText(text).width; return width; + */ }; const setFontinText = (text, font, color, bold=false) => { @@ -378,7 +386,7 @@ class PaperSheetStamper extends Component { // This creates the html from marked text as well as the form fields const createPreview = ( - value, + value, text, do_fields = false, field_counter, @@ -440,7 +448,7 @@ class PaperSheetEdit extends Component { createPreviewFromData(value, do_fields = false) { const { data } = useBackend(this.context); - return createPreview(value, + return createPreview(value, this.state.old_text, do_fields, this.state.counter,