Skip to content

Commit

Permalink
Corrected error in getting NotFound for find
Browse files Browse the repository at this point in the history
  • Loading branch information
bougyman committed Apr 15, 2024
1 parent 52f4a13 commit 22bc9c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/linear/commands/issue/take.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Take

def call(issue_ids:, **options)
updates = issue_ids.map do |issue_id|
Rubyists::Linear::Issue.find(issue_id)
gimme_da_issue! issue_id # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
rescue NotFoundError => e
logger.warn e.message
Expand Down
2 changes: 1 addition & 1 deletion lib/linear/models/base_model/class_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def find(id_val)
sym = camel_name.to_sym
ff = full_fragment
query_data = Api.query(query { __node(camel_name, id: id_val) { ___ ff } })
raise NotFoundError, "No #{just_name} found with id #{id_val}" if query_data[sym].nil?
raise NotFoundError, "No #{just_name} found with id #{id_val}" if query_data.nil? || query_data[sym].nil?

new query_data[sym]
end
Expand Down

0 comments on commit 22bc9c3

Please sign in to comment.