Skip to content

Commit

Permalink
Merge pull request #132 from gyorokpeter/openTab
Browse files Browse the repository at this point in the history
fix null pointer exception when opening files
  • Loading branch information
gyorokpeter authored Jun 28, 2022
2 parents e2a2070 + 76efaef commit 75283fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ dependencies {
intTestImplementation group: 'org.assertj', name: 'assertj-swing-junit', version: '3.9.2'
}

application {
mainClass = 'studio.core.Studio'
jar {
manifest {
attributes(
'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' '),
'Main-Class': 'studio.core.Studio'
)
}
}

def buildTime() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/studio/ui/StudioPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ private void openOrSwitchToFile(String filename) {
addToMruFiles(filename);
for (int i=0; i<tabbedEditors.getTabCount(); ++i) {
EditorTab tab = getEditor(i);
if (tab.getFilename().equals(filename)) {
String fileName = tab.getFilename();
if (fileName != null && fileName.equals(filename)) {
tabbedEditors.setSelectedIndex(i);
return;
}
Expand Down

0 comments on commit 75283fd

Please sign in to comment.