Skip to content

Commit

Permalink
Fix a hard to reproduce paste preview crash
Browse files Browse the repository at this point in the history
I don't have anything particularly good to say here. Tl;dr the code allowed nils to be attempted to be put on the socket in place of mouse position components. This is the problem with "delay line" logic like this; when it's buggy, the bugs are hard to reproduce and to describe.
  • Loading branch information
LBPHacker committed Sep 10, 2023
1 parent 73992c4 commit a45b8c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tptmp/client/profile/vanilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,9 @@ function profile_i:handle_tick()
local complete_select_mode = self.select_x_ and self.select_mode_
if self.prev_select_mode_ ~= complete_select_mode then
self.prev_select_mode_ = complete_select_mode
if self.select_mode_ == "copy"
or self.select_mode_ == "cut"
or self.select_mode_ == "stamp" then
if self.select_x_ and (self.select_mode_ == "copy" or
self.select_mode_ == "cut" or
self.select_mode_ == "stamp") then
if self.select_mode_ == "copy" then
self:report_selectstatus_(1, self.select_x_, self.select_y_)
elseif self.select_mode_ == "cut" then
Expand All @@ -884,7 +884,7 @@ function profile_i:handle_tick()
local complete_place_mode = self.place_x_ and self.select_mode_
if self.prev_place_mode_ ~= complete_place_mode then
self.prev_place_mode_ = complete_place_mode
if self.select_mode_ == "place" then
if self.place_x_ and self.select_mode_ == "place" then
self:report_placestatus_(1, self.place_x_, self.place_y_)
else
self.place_x_, self.place_y_ = nil, nil
Expand Down

0 comments on commit a45b8c5

Please sign in to comment.