diff --git a/deps/ox/src/ox/fs/filesystem/filelocation.hpp b/deps/ox/src/ox/fs/filesystem/filelocation.hpp index 878d5043..790db568 100644 --- a/deps/ox/src/ox/fs/filesystem/filelocation.hpp +++ b/deps/ox/src/ox/fs/filesystem/filelocation.hpp @@ -145,11 +145,15 @@ constexpr Error model(T *io, CommonPtrWith auto *fa) noexcept { int8_t type = 0; oxReturnError(io->field("type", &type)); oxReturnError(io->field("data", UnionView(&fa->m_data, 0))); - } else { + } else if constexpr(ox_strcmp(T::opType(), OpType::Read) == 0) { auto type = static_cast(fa->m_type); oxReturnError(io->field("type", &type)); fa->m_type = static_cast(type); oxReturnError(io->field("data", UnionView(&fa->m_data, static_cast(fa->m_type)))); + } else if constexpr(ox_strcmp(T::opType(), OpType::Write) == 0) { + auto type = static_cast(fa->m_type); + oxReturnError(io->field("type", &type)); + oxReturnError(io->field("data", UnionView(&fa->m_data, static_cast(fa->m_type)))); } return OxError(0); }