mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 14:21:04 +08:00
Assert against invalid function name
In testing I tried passing `nullptr` to this function which caused a segfault on Linux. If we know that's an invalid input then lets assert against it.
This commit is contained in:
parent
3750074238
commit
52de41294e
@ -27,6 +27,8 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Vulkan.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#if defined(SFML_SYSTEM_WINDOWS)
|
||||
|
||||
#include <SFML/Window/Win32/VulkanImplWin32.hpp>
|
||||
@ -73,6 +75,8 @@ bool Vulkan::isAvailable([[maybe_unused]] bool requireGraphics)
|
||||
////////////////////////////////////////////////////////////
|
||||
VulkanFunctionPointer Vulkan::getFunction([[maybe_unused]] const char* name)
|
||||
{
|
||||
assert(name && "Name cannot be a null pointer");
|
||||
|
||||
#if defined(SFML_VULKAN_IMPLEMENTATION_NOT_AVAILABLE)
|
||||
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user