Skip to content

Comments

fixes a nil pointer dereference crash and adds backward compatibility for proto import paths#298

Open
shrutipathak2 wants to merge 1 commit intoinfobloxopen:mainfrom
shrutipathak2:bugfix/v1.0.1-crash-fix
Open

fixes a nil pointer dereference crash and adds backward compatibility for proto import paths#298
shrutipathak2 wants to merge 1 commit intoinfobloxopen:mainfrom
shrutipathak2:bugfix/v1.0.1-crash-fix

Conversation

@shrutipathak2
Copy link

@shrutipathak2 shrutipathak2 commented Feb 24, 2026

Summary

This PR fixes a nil pointer dereference crash and adds backward compatibility for proto import paths.

Changes

1. Bug Fix: Nil Pointer Dereference in Plugin

Fixed crash that occurred when processing proto files with non-message field types (e.g., primitive types like int32, string).

Affected functions in plugin/plugin.go:

  • followsUpdateConventions() - Added nil checks at lines 3171 and 3189
  • followsUpdateSetConventions() - Added nil check at line 3109
  1. Proto Import Path Backward Compatibility
    Added symlinks to support both old and new proto import paths:

// Both paths now work
import "github.com/infobloxopen/protoc-gen-gorm/options/gorm.proto"; // old
import "github.com/infobloxopen/protoc-gen-gorm/proto/options/gorm.proto"; // new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant