diff --git a/code/modules/nano/nanoexternal.dm b/code/modules/nano/nanoexternal.dm index fed8cb4c4f7..ff4c85ba7f5 100644 --- a/code/modules/nano/nanoexternal.dm +++ b/code/modules/nano/nanoexternal.dm @@ -1,5 +1,5 @@ - // This file contains all Nano procs/definitions for external classes/objects - + // This file contains all Nano procs/definitions for external classes/objects + /** * Called when a Nano UI window is closed * This is how Nano handles closed windows @@ -13,9 +13,9 @@ var/datum/nanoui/ui = locate(uiref) - if (ui) + if (istype(ui)) ui.close() - + if(ui.ref) var/href = "close=1" src.Topic(href, params2list(href), ui.ref) // this will direct to the atom's Topic() proc via client.Topic() @@ -31,13 +31,13 @@ * ui_interact is currently defined for /atom/movable * * @param user /mob The mob who is interacting with this ui - * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") + * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") * @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui * * @return nothing */ /atom/movable/proc/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null) return - + // Used by the Nano UI Manager (/datum/nanomanager) to track UIs opened by this mob /mob/var/list/open_uis = list() diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 67f25e5b535..5171d0e59ff 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -413,7 +413,7 @@ nanoui is used to open and update nano browser uis if (status != STATUS_INTERACTIVE || user != usr) // If UI is not interactive or usr calling Topic is not the UI user return - if (src_object.Topic(href, href_list)) + if (src_object && src_object.Topic(href, href_list)) nanomanager.update_uis(src_object) // update all UIs attached to src_object /**