summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorK-Adam <kecskes.adam@outlook.com>2021-07-27 20:42:28 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-27 23:48:23 +0200
commit95f393ebcd750ec9a5f876dab09418c2aa913ab4 (patch)
treee50b6bc1f112df1e99474620cfbdf7bd5b7781c9 /Userland/Libraries
parent7f1677d574012d3c5ee99e3f266d6299948ee54a (diff)
downloadserenity-95f393ebcd750ec9a5f876dab09418c2aa913ab4.zip
LibWeb: Return null if an unknown canvas context type is requested
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
index 63e42b8b8d..857887da64 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp
@@ -47,7 +47,8 @@ RefPtr<Layout::Node> HTMLCanvasElement::create_layout_node()
CanvasRenderingContext2D* HTMLCanvasElement::get_context(String type)
{
- VERIFY(type == "2d");
+ if (type != "2d")
+ return nullptr;
if (!m_context)
m_context = CanvasRenderingContext2D::create(*this);
return m_context;