--- old/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp 2017-04-29 14:24:03.453101000 +0530 +++ new/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp 2017-04-29 14:24:03.244997000 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -205,14 +205,18 @@ static jstring jstringFromSTRRET(JNIEnv* env, LPITEMIDLIST pidl, STRRET* pStrret) { switch (pStrret->uType) { case STRRET_CSTR : - return JNU_NewStringPlatform(env, reinterpret_cast(pStrret->cStr)); + if (pStrret->cStr != NULL) { + return JNU_NewStringPlatform(env, reinterpret_cast(pStrret->cStr)); + } case STRRET_OFFSET : // Note : this may need to be WCHAR instead return JNU_NewStringPlatform(env, (CHAR*)pidl + pStrret->uOffset); case STRRET_WSTR : - return env->NewString(reinterpret_cast(pStrret->pOleStr), - static_cast(wcslen(pStrret->pOleStr))); + if (pStrret->pOleStr != NULL) { + return env->NewString(reinterpret_cast(pStrret->pOleStr), + static_cast(wcslen(pStrret->pOleStr))); + } } return NULL; }