public String decryptOrNull(String data) {
        try {
            return decrypt(data);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
public String decryptOrNull ( String data ) { try { return decrypt ( data ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return null ; } }
This is a sugar method that calls decrypt method and catch the exceptions returning
{@code null} when it occurs and logging the error

@param data the String to be decrypted

@return the decrypted String or {@code null} if you send the data as {@code null}