diff --git a/Libraries/LibGUI/ModelIndex.h b/Libraries/LibGUI/ModelIndex.h index cdac89c85e..6c2c449f8f 100644 --- a/Libraries/LibGUI/ModelIndex.h +++ b/Libraries/LibGUI/ModelIndex.h @@ -38,7 +38,7 @@ class ModelIndex { public: ModelIndex() { } - bool is_valid() const { return m_row != -1 && m_column != -1; } + bool is_valid() const { return m_model && m_row != -1 && m_column != -1; } int row() const { return m_row; } int column() const { return m_column; }