File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ pub unsafe fn set_system_table(ptr: *const uefi_raw::table::system::SystemTable)
42
42
/// [`exit_boot_services`]: SystemTable::exit_boot_services
43
43
pub fn system_table_boot ( ) -> Option < SystemTable < Boot > > {
44
44
let st = SYSTEM_TABLE . load ( Ordering :: Acquire ) ;
45
- assert ! ( !st. is_null( ) ) ;
45
+
46
+ if st. is_null ( ) {
47
+ return None ;
48
+ }
46
49
47
50
// SAFETY: the system table is valid per the requirements of `set_system_table`.
48
51
unsafe {
@@ -62,7 +65,10 @@ pub fn system_table_boot() -> Option<SystemTable<Boot>> {
62
65
/// Panics if the system table has not been set with [`set_system_table`].
63
66
pub fn system_table_runtime ( ) -> Option < SystemTable < Runtime > > {
64
67
let st = SYSTEM_TABLE . load ( Ordering :: Acquire ) ;
65
- assert ! ( !st. is_null( ) ) ;
68
+
69
+ if st. is_null ( ) {
70
+ return None ;
71
+ }
66
72
67
73
// SAFETY: the system table is valid per the requirements of `set_system_table`.
68
74
unsafe {
You can’t perform that action at this time.
0 commit comments