enigmaiitd / CampusHack

Library Portal to show currently issued books from IITD Library
1 stars 0 forks source link

Issue in generating dummy BookInfo[] variable #5

Closed tmibvishal closed 5 years ago

tmibvishal commented 5 years ago

I have separated the BookInfo class because I wanted to make it public But there is some issue now in generating dummy BookInfo[] variable

2019-02-10 09:38:14.783 16260-16260/iitd.enigma.libraryportal E/AndroidRuntime: FATAL EXCEPTION: main
    Process: iitd.enigma.libraryportal, PID: 16260
    java.lang.RuntimeException: Unable to start activity ComponentInfo{iitd.enigma.libraryportal/iitd.enigma.libraryportal.Library_Info_Activity}: java.lang.NullPointerException: Attempt to write to field 'java.lang.String iitd.enigma.libraryportal.BookInfo.issuedTo' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.NullPointerException: Attempt to write to field 'java.lang.String iitd.enigma.libraryportal.BookInfo.issuedTo' on a null object reference
        at iitd.enigma.libraryportal.LibraryMail.generateDummyInfo(LibraryMail.java:114)
        at iitd.enigma.libraryportal.Library_Info_Activity.onCreate(Library_Info_Activity.java:34)
        at android.app.Activity.performCreate(Activity.java:7009)
        at android.app.Activity.performCreate(Activity.java:7000)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
arpit-saxena commented 5 years ago

Should be fixed as of https://github.com/enigmaiitd/CampusHack/commit/b0097c41df15389b9c4667ce778a48a83a922f39

tmibvishal commented 5 years ago

Ya I also fixed that as of 4ce9602 @arpit-saxena