Skip to content

Commit 87e0354

Browse files
committed
🐛 fix get_instance()->router->directory on null issue
Signed-off-by: otengkwame <developerkwame@gmail.com>
1 parent 3d99d53 commit 87e0354

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Core/core/Base_Exceptions.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ public function show_exception($exception)
108108
show_404();
109109
}
110110

111-
$directory = (get_instance()) ? get_instance()->router->directory : '';
112-
111+
$directory = (get_instance()->router->directory != null)
112+
? get_instance()->router->directory
113+
: '';
114+
113115
$location = str_replace('../', '', (string) $directory);
114116

115117
$filepath = function_exists('session') ? session('__view_path') : $exception->getFile();
@@ -176,8 +178,10 @@ public function show_php_error($severity, $message, $filepath, $line)
176178
$templates_path = VIEWPATH . 'errors' . DIRECTORY_SEPARATOR;
177179
}
178180

179-
$directory = (get_instance()) ? get_instance()->router->directory : '';
180-
181+
$directory = (get_instance()->router->directory != null)
182+
? get_instance()->router->directory
183+
: '';
184+
181185
$location = str_replace('../', '', (string) $directory);
182186

183187
$filelocation = $filepath;

0 commit comments

Comments
 (0)