Skip to content

Commit 22bc9c3

Browse files
committed
Corrected error in getting NotFound for find
1 parent 52f4a13 commit 22bc9c3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/linear/commands/issue/take.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Take
2121

2222
def call(issue_ids:, **options)
2323
updates = issue_ids.map do |issue_id|
24+
Rubyists::Linear::Issue.find(issue_id)
2425
gimme_da_issue! issue_id # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
2526
rescue NotFoundError => e
2627
logger.warn e.message

lib/linear/models/base_model/class_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def find(id_val)
5555
sym = camel_name.to_sym
5656
ff = full_fragment
5757
query_data = Api.query(query { __node(camel_name, id: id_val) { ___ ff } })
58-
raise NotFoundError, "No #{just_name} found with id #{id_val}" if query_data[sym].nil?
58+
raise NotFoundError, "No #{just_name} found with id #{id_val}" if query_data.nil? || query_data[sym].nil?
5959

6060
new query_data[sym]
6161
end

0 commit comments

Comments
 (0)