mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-24 17:50:31 +01:00
Return nullptr pointer for empty core::array
fixes minetest/minetest#12532
This commit is contained in:
parent
67c0cb5740
commit
abebac8bd4
@ -227,7 +227,7 @@ public:
|
||||
/** \return Pointer to the array. */
|
||||
T* pointer()
|
||||
{
|
||||
return &m_data[0];
|
||||
return m_data.empty() ? nullptr : &m_data[0];
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@ public:
|
||||
/** \return Pointer to the array. */
|
||||
const T* const_pointer() const
|
||||
{
|
||||
return &m_data[0];
|
||||
return m_data.empty() ? nullptr : &m_data[0];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user