gcflames5 / ynab-splitwise-integration

A tool to copy transactions from Splitiwise to YNAB for budgeting purposes.
25 stars 6 forks source link

Exception in thread "main" java.lang.NullPointerException at com.github.gclfames5.Main.main(Main.java:114) #2

Closed ethanbayliss closed 4 years ago

ethanbayliss commented 4 years ago

Got this error on first run - I'm not sure how to debug, I'm installing eclipse now...

https://github.com/gcflames5/ynab-splitwise-integration/blob/e994cee1b371a9e7da56849accd7e24cd82c0008/src/main/java/com/github/gclfames5/Main.java#L114

C:\ynabsplitwisesync>java -jar ynab-splitwise.jar Configuration not specified via command line. Defaulting to ./config.yml. To specify a custom path, add path as a command line argument. Configuration path: C:\ynabsplitwisesync\config.yml Reading configuration... Authenticating Splitwise... Fetching spltiwise transactions since Thu Jan 01 08:00:00 AWST 1970 Authenticating YNAB... New transaction found: Expense: [desc: Rent, cost: -310.000000, date: Mon Sep 02 23:58:57 AWST 2019] New transaction found: Expense: [desc: Payment, cost: -11.260000, date: Wed Sep 04 03:09:00 AWST 2019] New transaction found: Expense: [desc: Payment, cost: -15.230000, date: Wed Sep 04 03:08:54 AWST 2019] New transaction found: Expense: [desc: Payment, cost: -23.450000, date: Wed Sep 04 03:08:45 AWST 2019] New transaction found: Expense: [desc: Payment, cost: -114.430000, date: Wed Sep 04 01:58:56 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 310.000000, date: Mon Sep 02 12:19:05 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 1.530000, date: Mon Aug 19 06:08:31 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 31.350000, date: Mon Aug 19 06:08:28 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 310.000000, date: Mon Aug 19 06:06:33 AWST 2019] New transaction found: Expense: [desc: Ikea, cost: -31.350000, date: Sun Aug 18 13:49:23 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 125.540000, date: Fri Aug 16 11:41:04 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 25.220000, date: Fri Aug 16 11:39:34 AWST 2019] New transaction found: Expense: [desc: Uber eats, cost: -25.220000, date: Wed Aug 14 14:25:30 AWST 2019] New transaction found: Expense: [desc: Payment, cost: 15.450000, date: Mon Jan 15 10:06:05 AWST 2018] New transaction found: Expense: [desc: Settle all balances, cost: 67.510000, date: Sun Sep 24 10:24:21 AWST 2017] New transaction found: Expense: [desc: Payment, cost: -50.980000, date: Sun Sep 24 10:24:20 AWST 2017] New transaction found: Expense: [desc: Payment, cost: -41.530000, date: Sun Sep 24 10:08:21 AWST 2017] Exception in thread "main" java.lang.NullPointerException at com.github.gclfames5.Main.main(Main.java:114)

gcflames5 commented 4 years ago

I think this is an issue with it not correctly handling existing ynab transactions without memos correctly, should be able to fix with a null check on getMemo()

I'll push a fix later today

ethanbayliss commented 4 years ago

Just to make it easier for you to reproduce - my "Splitwise" account in ynab is completely blank.

gcflames5 commented 4 years ago

ynab-splitwise-jar-with-dependencies.zip

Let me know if this works, if it does I'll update the repo

ethanbayliss commented 4 years ago

Yep works great!