commitbee 0.6.0

AI-powered commit message generator using tree-sitter semantic analysis and local LLMs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/pkg/handler/user.go b/pkg/handler/user.go
index abc1234..def5678 100644
--- a/pkg/handler/user.go
+++ b/pkg/handler/user.go
@@ -15,7 +15,12 @@ func (h *UserHandler) GetProfile(w http.ResponseWriter, r *http.Request) {
     userID := r.URL.Query().Get("id")
     user, err := h.store.FindByID(userID)
-    if err != nil {
+    // Fix: check for nil user before accessing fields
+    // Bug: FindByID returns (nil, nil) for missing users, causing panic
+    if err != nil {
+        http.Error(w, "internal error", http.StatusInternalServerError)
+        return
+    }
+    if user == nil {
         http.Error(w, "not found", http.StatusNotFound)
         return
     }