diff options
| author | Jacob McDonnell <jacob@simplelittledream.com> | 2021-12-10 10:34:53 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@simplelittledream.com> | 2021-12-10 10:34:53 -0500 |
| commit | 4fd05739633d1699992a833d59a9e102017e545f (patch) | |
| tree | 0a9949c8a022d8b3dedd2686174d2369bf54d098 | |
| parent | 5dacd371566db977923e6da4c7c9783050608321 (diff) | |
Fixed null pointer when launching without filename
| -rw-r--r-- | build/.DS_Store | bin | 0 -> 6148 bytes | |||
| -rw-r--r-- | src/.DS_Store | bin | 0 -> 6148 bytes | |||
| -rw-r--r-- | src/filebuffer.java | 6 |
3 files changed, 4 insertions, 2 deletions
diff --git a/build/.DS_Store b/build/.DS_Store Binary files differnew file mode 100644 index 0000000..ce4d425 --- /dev/null +++ b/build/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store Binary files differnew file mode 100644 index 0000000..f80d659 --- /dev/null +++ b/src/.DS_Store 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 */ |
