Skip to content

Commit ce704e2

Browse files
authored
Merge pull request processing#4582 from JakubValtar/fix-network-locations
Fix running PDE from network locations
2 parents f1d3f24 + 16f4508 commit ce704e2

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/src/processing/app/Language.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ static class LanguageBundle {
316316

317317
void read(File additions) {
318318
String[] lines = PApplet.loadStrings(additions);
319+
if (lines == null) {
320+
throw new NullPointerException("File not found:\n" + additions.getAbsolutePath());
321+
}
319322
//for (String line : lines) {
320323
for (int i = 0; i < lines.length; i++) {
321324
String line = lines[i];

app/src/processing/app/Platform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static public File getContentFile(String name) {
288288
// Decode URL
289289
String decodedPath;
290290
try {
291-
decodedPath = pathURL.toURI().getPath();
291+
decodedPath = pathURL.toURI().getSchemeSpecificPart();
292292
} catch (URISyntaxException e) {
293293
e.printStackTrace();
294294
return null;

core/src/processing/core/PApplet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7413,7 +7413,7 @@ static protected String calcSketchPath() {
74137413
URL jarURL =
74147414
PApplet.class.getProtectionDomain().getCodeSource().getLocation();
74157415
// Decode URL
7416-
String jarPath = jarURL.toURI().getPath();
7416+
String jarPath = jarURL.toURI().getSchemeSpecificPart();
74177417

74187418
// Workaround for bug in Java for OS X from Oracle (7u51)
74197419
// https://github.com/processing/processing/issues/2181

0 commit comments

Comments
 (0)