Skip to content

Commit

Permalink
Merge pull request #25 from jwijenbergh/fix-tinywl-crash
Browse files Browse the repository at this point in the history
TinyWL Server: Nil check xdgSurface in topLevelAt
  • Loading branch information
alexbakker authored Mar 26, 2024
2 parents a5c17f7 + 6ed0e6f commit 7241d52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/tinywl/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ func (s *Server) topLevelAt(lx float64, ly float64) (*wlroots.XDGTopLevel, *wlro
/* Find the node corresponding to the tinywl_toplevel at the root of this
* surface tree, it is the only one for which we set the data field. */

topLevel := surface.XDGSurface().TopLevel()
xdgSurface := surface.XDGSurface()
if xdgSurface.Nil() {
return nil, nil, 0, 0
}
topLevel := xdgSurface.TopLevel()
slog.Debug("topLevelAt", "topLevel", topLevel)
slog.Debug("topLevelAt", "s.topLevelList.Len()", s.topLevelList.Len())

Expand Down

0 comments on commit 7241d52

Please sign in to comment.