# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1602419248 -7200
# Node ID 498b3ab49b9cd4cb38a65d6111a15771f1cc201a
# Parent  0cfa36fa707ea45beaaaa427c1f87a300ac14175
core.modulemanager: Fix error if installer path missing

Happens if run outside prosody. Noticed because because the storage
tests fail.

diff -r 0cfa36fa707e -r 498b3ab49b9c core/modulemanager.lua
--- a/core/modulemanager.lua	Fri Oct 09 17:41:10 2020 +0200
+++ b/core/modulemanager.lua	Sun Oct 11 14:27:28 2020 +0200
@@ -199,7 +199,7 @@
 	api_instance.path = err;
 
 	local custom_plugins = prosody.paths.installer;
-	if err:sub(1, #custom_plugins+1) == custom_plugins.."/" then
+	if custom_plugins and err:sub(1, #custom_plugins+1) == custom_plugins.."/" then
 		-- Stage 1: Make it work (you are here)
 		-- Stage 2: Make it less hacky (TODO)
 		local manifest = {};