mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:26:39 +00:00 
			
		
		
		
	Avoid exception if class ID is not found, instead don't show any fields in the gui.
This commit is contained in:
		
							parent
							
								
									aaa80d1eb0
								
							
						
					
					
						commit
						e6ad68b8d0
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -240,7 +240,9 @@ void PickClassDialog::updateStats()
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    WindowManager *wm = environment.mWindowManager;
 | 
					    WindowManager *wm = environment.mWindowManager;
 | 
				
			||||||
    ESMS::ESMStore &store = environment.mWorld->getStore();
 | 
					    ESMS::ESMStore &store = environment.mWorld->getStore();
 | 
				
			||||||
    const ESM::Class *klass = store.classes.find(currentClassId);
 | 
					    const ESM::Class *klass = store.classes.search(currentClassId);
 | 
				
			||||||
 | 
					    if (!klass)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ESM::Class::Specialization specialization = static_cast<ESM::Class::Specialization>(klass->data.specialization);
 | 
					    ESM::Class::Specialization specialization = static_cast<ESM::Class::Specialization>(klass->data.specialization);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue