[PR #14853] [CLOSED] fix: Correct json.Unmarshal error handling logic #25415

Closed
opened 2026-04-19 18:12:25 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14853
Author: @LincolnBurrows2017
Created: 3/14/2026
Status: Closed

Base: mainHead: fix-json-unmarshal-logic


📝 Commits (1)

  • 22cc767 fix: correct json.Unmarshal error handling logic in openclaw.go

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 cmd/launch/openclaw.go (+3 -3)

📄 Description

Summary

Fixed 3 instances of inverted json.Unmarshal error handling logic in cmd/launch/openclaw.go:

Line Before After
182 if json.Unmarshal(data, &config) != nil if err := json.Unmarshal(data, &config); err != nil
577 if json.Unmarshal(data, &sessions) != nil if err := json.Unmarshal(data, &sessions); err != nil
660 if json.Unmarshal(data, &config) != nil if err := json.Unmarshal(data, &config); err != nil

Bug: The original logic was inverted - it returned/continued on success instead of failure.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14853 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-json-unmarshal-logic` --- ### 📝 Commits (1) - [`22cc767`](https://github.com/ollama/ollama/commit/22cc767ae7f8a46ec5499c6609c1164e2fce5e5b) fix: correct json.Unmarshal error handling logic in openclaw.go ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `cmd/launch/openclaw.go` (+3 -3) </details> ### 📄 Description ## Summary Fixed 3 instances of inverted json.Unmarshal error handling logic in `cmd/launch/openclaw.go`: | Line | Before | After | |------|--------|-------| | 182 | `if json.Unmarshal(data, &config) != nil` | `if err := json.Unmarshal(data, &config); err != nil` | | 577 | `if json.Unmarshal(data, &sessions) != nil` | `if err := json.Unmarshal(data, &sessions); err != nil` | | 660 | `if json.Unmarshal(data, &config) != nil` | `if err := json.Unmarshal(data, &config); err != nil` | **Bug:** The original logic was inverted - it returned/continued on success instead of failure. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 18:12:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#25415