From 0e959ce2e40547bd28c216ad0cf61df7e34e2a76 Mon Sep 17 00:00:00 2001 From: Don Park Date: Wed, 21 Aug 2019 15:20:40 -0700 Subject: [PATCH] check profileget response code --- src/main.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index a5424dd..8a5d860 100644 --- a/src/main.zig +++ b/src/main.zig @@ -287,8 +287,12 @@ fn photoback(command: *thread.Command) void { fn profileback(command: *thread.Command) void { const reqres = command.verb.http; - reqres.column.account = command.verb.http.tree.root.Object; - gui.schedule(gui.update_column_ui_schedule, @ptrCast(*c_void, reqres.column)); + if (reqres.response_code >= 200 and reqres.response_code < 300) { + reqres.column.account = reqres.tree.root.Object; + gui.schedule(gui.update_column_ui_schedule, @ptrCast(*c_void, reqres.column)); + } else { + warn("profile fail http status {}\n", reqres.response_code); + } } fn cache_update(toot: *toot_lib.Type) void {