Skip to content

Commit faef2ae

Browse files
committed
Detect incorrect argument to set_root
1 parent b0cb5fc commit faef2ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/scenic/view_port.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ defmodule Scenic.ViewPort do
420420
GenServer.call(pid, {:set_root, scene, args})
421421
end
422422

423+
def set_root(_, %Scene{} = scene, _) do
424+
raise "You must pass the module that represents the scene you want to switch to here, not a `%Scenic.Scene{}`"
425+
end
426+
423427
# --------------------------------------------------------
424428
@doc """
425429
Send raw input to a viewport.

0 commit comments

Comments
 (0)