From 38bb9afea863efda1e25e16e9a3352a7d4195e63 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 11 Mar 2022 16:40:12 +0000 Subject: [PATCH] Browser: Don't crash when selecting nothing in the Inspector DOM tree --- Userland/Applications/Browser/InspectorWidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp index 488f35c8efb..bcd1abc7b07 100644 --- a/Userland/Applications/Browser/InspectorWidget.cpp +++ b/Userland/Applications/Browser/InspectorWidget.cpp @@ -43,6 +43,9 @@ void InspectorWidget::set_selection(Selection selection) void InspectorWidget::set_selection(GUI::ModelIndex const index) { + if (!index.is_valid()) + return; + auto* json = static_cast(index.internal_data()); VERIFY(json);