1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:38:13 +00:00

GVariant: Don't crash when extracting a null String.

This commit is contained in:
Andreas Kling 2019-04-12 14:43:44 +02:00
parent 054c982181
commit 8f4c59c276
3 changed files with 39 additions and 3 deletions

View file

@ -19,6 +19,12 @@ public:
GVariant(Color);
GVariant(const GVariant&);
GVariant& operator=(const GVariant&);
GVariant(GVariant&&) = delete;
GVariant& operator=(GVariant&&) = delete;
void clear();
~GVariant();
enum class Type {
@ -84,7 +90,7 @@ public:
String as_string() const
{
ASSERT(type() == Type::String);
return *m_value.as_string;
return m_value.as_string;
}
const GraphicsBitmap& as_bitmap() const
@ -118,6 +124,8 @@ public:
bool operator<(const GVariant&) const;
private:
void copy_from(const GVariant&);
struct RawPoint {
int x;
int y;