Skip to content

Commit 15468c7

Browse files
committed
Corrected ProgramExaminer NPE
1 parent 4f73af4 commit 15468c7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Ghidra/Features/Base/src/main/java/ghidra/app/util/importer/LcsHintLoadSpecChooser.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@ public class LcsHintLoadSpecChooser implements LoadSpecChooser {
3737
* {@link CompilerSpec}.
3838
*
3939
* @param language The {@link Language} to use (should not be null)
40-
* @param compilerSpec The {@link CompilerSpec} to use (should not be null)
40+
* @param compilerSpec The {@link CompilerSpec} to use (f null default compiler spec will be used)
4141
*/
4242
public LcsHintLoadSpecChooser(Language language, CompilerSpec compilerSpec) {
4343
this.languageID = language.getLanguageID();
44-
this.compilerSpecID = compilerSpec.getCompilerSpecID();
44+
this.compilerSpecID =
45+
(compilerSpec == null) ? language.getDefaultCompilerSpec().getCompilerSpecID()
46+
: compilerSpec.getCompilerSpecID();
4547
}
4648

4749
@Override
4850
public LoadSpec choose(LoaderMap loaderMap) {
49-
51+
5052
// Use the highest priority loader (it will be the first one)
5153
Loader loader = loaderMap.keySet().stream().findFirst().orElse(null);
5254
if (loader == null) {

0 commit comments

Comments
 (0)