From 558d6e192dd71d8a8fb917b00e77b158875ecc6c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 17 Jan 2016 14:47:34 +0100 Subject: [PATCH] placed this back, bad OG :) (nw) --- src/emu/device.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/emu/device.h b/src/emu/device.h index 2685e3ca1d6..70317bb6e22 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -589,6 +589,10 @@ private: inline device_t *device_t::subdevice(std::string tag) const { + // safety first + if (this == nullptr) + return nullptr; + // empty string means this device if (tag.empty()) return const_cast(this); @@ -606,6 +610,10 @@ inline device_t *device_t::subdevice(std::string tag) const inline device_t *device_t::siblingdevice(std::string tag) const { + // safety first + if (this == nullptr) + return nullptr; + // empty string or NULL means this device if (tag.empty()) return const_cast(this);