Skip to content

Commit 673ac55

Browse files
committedMay 20, 2017
[CSM] Fix crash when the minimap is disabled. Caused by e25a38e
1 parent 1469424 commit 673ac55

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

Diff for: ‎clientmods/preview/init.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ core.register_chatcommand("test_node", {
7878

7979
local function preview_minimap()
8080
local minimap = core.ui.minimap
81+
if not minimap then
82+
print("[PREVIEW] Minimap is disabled. Skipping.")
83+
return
84+
end
8185
minimap:set_mode(4)
8286
minimap:show()
8387
minimap:set_pos({x=5, y=50, z=5})
@@ -96,7 +100,9 @@ core.after(2, function()
96100
end)
97101

98102
core.after(5, function()
99-
core.ui.minimap:show()
103+
if core.ui.minimap then
104+
core.ui.minimap:show()
105+
end
100106

101107
print("[PREVIEW] Day count: " .. core.get_day_count() ..
102108
" time of day " .. core.get_timeofday())

0 commit comments

Comments
 (0)
Please sign in to comment.