Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: null pointer exception si no se tiene permiso para leer directorio de bibliotecas #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nilp0inter
Copy link

En linux, si alguno de los directorios donde se busca firefox es innacesible por falta de permisos se eleva la siguiente excepción:

INFO: Inicializamos el almacen de tipo: NSS
Exception in thread "main" java.lang.ExceptionInInitializerError
        at es.gob.afirma.keystores.mozilla.MozillaKeyStoreUtilities.getSystemNSSLibDir(MozillaKeyStoreUtilities.java:252)
        at es.gob.afirma.keystores.mozilla.MozillaKeyStoreUtilities.loadNSS(MozillaKeyStoreUtilities.java:706)
        at es.gob.afirma.keystores.mozilla.NssKeyStoreManager.getNssProvider(NssKeyStoreManager.java:122)
        at es.gob.afirma.keystores.mozilla.NssKeyStoreManager.init(NssKeyStoreManager.java:59)
        at es.gob.afirma.keystores.mozilla.MozillaUnifiedKeyStoreManager.init(MozillaUnifiedKeyStoreManager.java:77)
        at es.gob.afirma.keystores.AOKeyStoreManagerFactory.getNssKeyStoreManager(AOKeyStoreManagerFactory.java:511)
        at es.gob.afirma.keystores.AOKeyStoreManagerFactory.getMozillaUnifiedKeyStoreManager(AOKeyStoreManagerFactory.java:542)
        at es.gob.afirma.keystores.AOKeyStoreManagerFactory.getAOKeyStoreManager(AOKeyStoreManagerFactory.java:133)
        at es.gob.afirma.standalone.SimpleAfirma.main(SimpleAfirma.java:739)
Caused by: java.lang.NullPointerException: Cannot read the array length because "<local4>" is null
        at es.gob.afirma.keystores.mozilla.MozillaKeyStoreUtilitiesUnix.searchLastFirefoxVersion(MozillaKeyStoreUtilitiesUnix.java:157)
        at es.gob.afirma.keystores.mozilla.MozillaKeyStoreUtilitiesUnix.getNssPaths(MozillaKeyStoreUtilitiesUnix.java:87)
        at es.gob.afirma.keystores.mozilla.MozillaKeyStoreUtilitiesUnix.<clinit>(MozillaKeyStoreUtilitiesUnix.java:32)
        ... 9 more

Esta modificación comprueba que se ha podido listar el directorio.

nilp0inter added a commit to nilp0inter/autofirma-nix that referenced this pull request Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants