From 9b7523eefbd3c18c824056499256a7ff13ad4fa0 Mon Sep 17 00:00:00 2001 From: GplCart Date: Sun, 2 Sep 2018 03:16:27 +0300 Subject: [PATCH] Prevent PHP error when checking type in the map --- geoPHP.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geoPHP.inc b/geoPHP.inc index 78663042..9cf124aa 100644 --- a/geoPHP.inc +++ b/geoPHP.inc @@ -65,11 +65,11 @@ class geoPHP $args = $format; } - $processor_type = $type_map[$type]; - - if (!$processor_type) { + if (empty($type_map[$type])) { throw new exception('geoPHP could not find an adapter of type '.htmlentities($type)); } + + $processor_type = $type_map[$type]; $processor = new $processor_type();