Skip to content

Commit

Permalink
DEV: Safe navigation to handle to nil current_user class issue (#344)
Browse files Browse the repository at this point in the history
Another private plugin is extending this plugin and the current_user check here is a problem -- adding safe navigation does not break any existing functionality but allows for future changes.
  • Loading branch information
shuaib-swzd authored Dec 5, 2024
1 parent 04edc37 commit 2ea9951
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def run
query_params = {}
query_params = MultiJson.load(params[:params]) if params[:params]

opts = { current_user: current_user.username }
opts = { current_user: current_user&.username }
opts[:explain] = true if params[:explain] == "true"

opts[:limit] = if params[:format] == "csv"
Expand Down

0 comments on commit 2ea9951

Please sign in to comment.