Return error if a Page already exists in Session

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier authored and Pierre Tachoire committed 2024-05-02 17:52:23 +02:00
1 parent bcf4083f9c
commit df82d25e91
1 file changed
+2 -1
+2 -1
View File
@@ -132,7 +132,8 @@ pub const Page = struct {
fn init(
alloc: std.mem.Allocator,
session: *Session,
) Page {
) !Page {
if (session.page != null) return error.SessionPageExists;
var page = Page{
.arena = std.heap.ArenaAllocator.init(alloc),
.session = session,