Various Null Access Fixes (#22730)

<img width="1420" height="776" alt="image"
src="https://github.com/user-attachments/assets/d33c4ce2-9c5b-48c3-ac8b-5edfee51c7e0"
/>

Just a few fixes for some various runtime errors and two hard del
triggers on the Sentry logs.
This commit is contained in:
VMSolidus
2026-06-19 13:57:37 -04:00
committed by GitHub
parent 1c6938707c
commit a67a6ae94a
5 changed files with 23 additions and 11 deletions
+2 -2
View File
@@ -96,12 +96,12 @@
/datum/event/carp_migration/end(var/faked)
..()
for (var/carp_ref in spawned_carp)
var/datum/weakref/carp_weakref = carp_ref
for (var/datum/weakref/carp_weakref in spawned_carp)
var/mob/living/simple_animal/hostile/carp/fish = carp_weakref.resolve()
if (fish && prob(50) && is_type_in_typecache(fish.loc, despawn_turfs))
spawned_carp -= carp_weakref
qdel(carp_weakref)
spawned_carp?.Cut()
/datum/event/carp_migration/cozmo/start()
..()
+6 -2
View File
@@ -34,8 +34,10 @@
..()
var/num_recovered = 0
for(var/drone in drones_list)
var/mob/living/simple_animal/hostile/icarus_drone/malf/D = drone
for(var/mob/living/simple_animal/hostile/icarus_drone/malf/D in drones_list)
if (QDELETED(D))
continue
spark(D.loc, 3)
D.beam_out()
num_recovered++
@@ -45,3 +47,5 @@
command_announcement.Announce(SSatlas.current_map.rogue_drone_end_message, "Rogue Drone Alert", new_sound = 'sound/AI/rogue_drone_end_message.ogg', zlevels = affecting_z)
else
command_announcement.Announce(SSatlas.current_map.rogue_drone_destroyed_message, "Rogue Drone Alert", new_sound = 'sound/AI/rogue_drone_destroyed_message.ogg', zlevels = affecting_z)
drones_list?.Cut()
+6 -2
View File
@@ -148,7 +148,9 @@
return P
else if (istype(c_item, /obj/item/paper_bundle))
var/obj/item/paper_bundle/B = bundlecopy(target, c_item, TRUE, toner)
sleep(15*B.pages.len)
if (!B)
return FALSE
sleep(15 * length(B.pages))
return B
else
to_chat(usr, SPAN_WARNING("\The [c_item] can't be copied by \the [target]."))
@@ -199,7 +201,7 @@
c.offset_y = copy.offset_y
var/list/temp_overlays = copy.overlays //Iterates through stamps
var/image/img //and puts a matching
for (var/j = 1, j <= min(temp_overlays.len, copy.ico.len), j++) //gray overlay onto the copy
for (var/j = 1, j <= min(length(temp_overlays), length(copy.ico)), j++) //gray overlay onto the copy
if (findtext(copy.ico[j], "cap") || findtext(copy.ico[j], "cent"))
img = image('icons/obj/bureaucracy.dmi', "paper_stamp-circle")
else if (findtext(copy.ico[j], "deny"))
@@ -270,6 +272,8 @@
W = copy_type(target, W, need_toner ? toner : 15, do_print)
if (!W)
continue
W.forceMove(p)
p.pages += W