Skip to content

Commit c35e57a

Browse files
committed
Don't report memory usage if it's unknown
1 parent 7c87db3 commit c35e57a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

app/src/processing/app/Sketch.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -1631,14 +1631,16 @@ protected void size(PreferencesMap prefs) throws RunnerException {
16311631
System.out.println(I18n
16321632
.format(_("Binary sketch size: {0} bytes (of a {1} byte maximum) - {2}% used"),
16331633
textSize, maxTextSize, textSize * 100 / maxTextSize));
1634-
if(maxDataSize > 0) {
1635-
System.out.println(I18n
1636-
.format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"),
1637-
dataSize, maxDataSize, dataSize * 100 / maxDataSize));
1638-
} else {
1639-
System.out.println(I18n
1640-
.format(_("Memory usage: {0} bytes"),
1641-
dataSize));
1634+
if(dataSize >= 0) {
1635+
if(maxDataSize > 0) {
1636+
System.out.println(I18n
1637+
.format(_("Memory usage: {0} bytes (of a {1} byte maximum) - {2}% used"),
1638+
dataSize, maxDataSize, dataSize * 100 / maxDataSize));
1639+
} else {
1640+
System.out.println(I18n
1641+
.format(_("Memory usage: {0} bytes"),
1642+
dataSize));
1643+
}
16421644
}
16431645
} catch (RunnerException e) {
16441646
System.err.println(I18n.format(_("Couldn't determine program size: {0}"),

0 commit comments

Comments
 (0)