Handle cases when std::optional does not contain a value
This commit is contained in:
		@@ -142,7 +142,6 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    /// Parameter data to be returned in the next call to Glance/ReceiveParameter.
 | 
			
		||||
    /// TODO(Subv): Use std::optional once we migrate to C++17.
 | 
			
		||||
    std::optional<MessageParameter> next_parameter;
 | 
			
		||||
 | 
			
		||||
    static constexpr std::size_t NumAppletSlot = 4;
 | 
			
		||||
 
 | 
			
		||||
@@ -205,8 +205,10 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
 | 
			
		||||
    // The shared font has to be relocated to the new address before being passed to the
 | 
			
		||||
    // application.
 | 
			
		||||
    VAddr target_address =
 | 
			
		||||
        *Memory::PhysicalToVirtualAddress(apt->shared_font_mem->linear_heap_phys_address);
 | 
			
		||||
    auto maybe_vaddr =
 | 
			
		||||
        Memory::PhysicalToVirtualAddress(apt->shared_font_mem->linear_heap_phys_address);
 | 
			
		||||
    ASSERT(maybe_vaddr);
 | 
			
		||||
    VAddr target_address = *maybe_vaddr;
 | 
			
		||||
    if (!apt->shared_font_relocated) {
 | 
			
		||||
        BCFNT::RelocateSharedFont(apt->shared_font_mem, target_address);
 | 
			
		||||
        apt->shared_font_relocated = true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user