mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +00:00
WAGE: Avoid calling method of nullptr
This commit is contained in:
parent
257a99bdb8
commit
f35cb961f2
@ -125,7 +125,7 @@ public:
|
||||
|
||||
void setDesignBounds(Common::Rect *bounds);
|
||||
|
||||
Common::String toString() { return _name; }
|
||||
Common::String toString() const { return _name; }
|
||||
};
|
||||
|
||||
class Chr : public Designed {
|
||||
|
@ -56,6 +56,13 @@
|
||||
|
||||
namespace Wage {
|
||||
|
||||
static Common::String toString(const Designed *d) {
|
||||
if (!d)
|
||||
return "<NULL>";
|
||||
else
|
||||
return d->toString();
|
||||
}
|
||||
|
||||
Common::String Script::Operand::toString() {
|
||||
switch(_type) {
|
||||
case NUMBER:
|
||||
@ -64,13 +71,13 @@ Common::String Script::Operand::toString() {
|
||||
case TEXT_INPUT:
|
||||
return *_value.string;
|
||||
case OBJ:
|
||||
return _value.obj->toString();
|
||||
return Wage::toString(_value.obj);
|
||||
case CHR:
|
||||
return _value.chr->toString();
|
||||
return Wage::toString(_value.chr);
|
||||
case SCENE:
|
||||
return _value.scene->toString();
|
||||
return Wage::toString(_value.scene);
|
||||
case CLICK_INPUT:
|
||||
return _value.inputClick->toString();
|
||||
return Wage::toString(_value.inputClick);
|
||||
default:
|
||||
error("Unhandled operand type: _type");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user