[ox/mc] Make write's setTypeInfo return Error if unable to allocate field presence buff
This commit is contained in:
parent
fbfc0afc89
commit
b2103e558e
3
deps/ox/src/ox/mc/write.hpp
vendored
3
deps/ox/src/ox/mc/write.hpp
vendored
@ -390,9 +390,8 @@ constexpr ox::Error MetalClawWriter<Writer>::setTypeInfo(
|
||||
int,
|
||||
const Vector<String>&,
|
||||
std::size_t fields) noexcept {
|
||||
// TODO: change all setTypeInfo signatures to return Errors
|
||||
const auto fieldPresenceLen = (fields - 1) / 8 + 1;
|
||||
oxIgnoreError(m_writer.write(nullptr, fieldPresenceLen));
|
||||
oxReturnError(m_writer.write(nullptr, fieldPresenceLen));
|
||||
m_presenceMapBuff.resize(fieldPresenceLen);
|
||||
m_fieldPresence.setBuffer(m_presenceMapBuff.data(), m_presenceMapBuff.size());
|
||||
m_fieldPresence.setFields(static_cast<int>(fields));
|
||||
|
Loading…
Reference in New Issue
Block a user