summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@simplelittledream.com>2021-12-10 10:34:53 -0500
committerJacob McDonnell <jacob@simplelittledream.com>2021-12-10 10:34:53 -0500
commit4fd05739633d1699992a833d59a9e102017e545f (patch)
tree0a9949c8a022d8b3dedd2686174d2369bf54d098
parent5dacd371566db977923e6da4c7c9783050608321 (diff)
Fixed null pointer when launching without filename
-rw-r--r--build/.DS_Storebin0 -> 6148 bytes
-rw-r--r--src/.DS_Storebin0 -> 6148 bytes
-rw-r--r--src/filebuffer.java6
3 files changed, 4 insertions, 2 deletions
diff --git a/build/.DS_Store b/build/.DS_Store
new file mode 100644
index 0000000..ce4d425
--- /dev/null
+++ b/build/.DS_Store
Binary files differ
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000..f80d659
--- /dev/null
+++ b/src/.DS_Store
Binary files differ
diff --git a/src/filebuffer.java b/src/filebuffer.java
index 4015b55..833f695 100644
--- a/src/filebuffer.java
+++ b/src/filebuffer.java
@@ -14,8 +14,10 @@ public class filebuffer {
public filebuffer(String fn, boolean hn) {
buffer = new ArrayList<String>(); // Arraylist that stores every line of a file in strings
hasName = hn;
- fileName = fn;
- readFile();
+ if (hn) {
+ fileName = fn;
+ readFile();
+ }
}
/* getFileSize: gets the size of the buffer arraylist */